Compare commits
No commits in common. "06a31ea5fd2dcafa4402c6801b0e16983a9b6267" and "0a60f378578a64192c28a6dd30dab84bec31ddfc" have entirely different histories.
06a31ea5fd
...
0a60f37857
3 changed files with 0 additions and 32 deletions
|
@ -55,8 +55,6 @@ pub const whitespace = struct {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const PosType = enum { column, byte };
|
|
||||||
|
|
||||||
pub const Match = struct {
|
pub const Match = struct {
|
||||||
begin: Cursor = Cursor{},
|
begin: Cursor = Cursor{},
|
||||||
end: Cursor = Cursor{},
|
end: Cursor = Cursor{},
|
||||||
|
@ -5412,18 +5410,11 @@ pub const Editor = struct {
|
||||||
var column: usize = 0;
|
var column: usize = 0;
|
||||||
var have_sel: bool = false;
|
var have_sel: bool = false;
|
||||||
var sel: Selection = .{};
|
var sel: Selection = .{};
|
||||||
var pos_type: PosType = .column;
|
|
||||||
if (try ctx.args.match(.{
|
if (try ctx.args.match(.{
|
||||||
tp.extract(&line),
|
tp.extract(&line),
|
||||||
tp.extract(&column),
|
tp.extract(&column),
|
||||||
})) {
|
})) {
|
||||||
// self.logger.print("goto: l:{d} c:{d}", .{ line, column });
|
// self.logger.print("goto: l:{d} c:{d}", .{ line, column });
|
||||||
} else if (try ctx.args.match(.{
|
|
||||||
tp.extract(&line),
|
|
||||||
tp.extract(&column),
|
|
||||||
tp.extract(&pos_type),
|
|
||||||
})) {
|
|
||||||
// self.logger.print("goto: l:{d} c:{d}", .{ line, column });
|
|
||||||
} else if (try ctx.args.match(.{
|
} else if (try ctx.args.match(.{
|
||||||
tp.extract(&line),
|
tp.extract(&line),
|
||||||
tp.extract(&column),
|
tp.extract(&column),
|
||||||
|
@ -5434,29 +5425,9 @@ pub const Editor = struct {
|
||||||
})) {
|
})) {
|
||||||
// self.logger.print("goto: l:{d} c:{d} {any}", .{ line, column, sel });
|
// self.logger.print("goto: l:{d} c:{d} {any}", .{ line, column, sel });
|
||||||
have_sel = true;
|
have_sel = true;
|
||||||
} else if (try ctx.args.match(.{
|
|
||||||
tp.extract(&line),
|
|
||||||
tp.extract(&column),
|
|
||||||
tp.extract(&sel.begin.row),
|
|
||||||
tp.extract(&sel.begin.col),
|
|
||||||
tp.extract(&sel.end.row),
|
|
||||||
tp.extract(&sel.end.col),
|
|
||||||
tp.extract(&pos_type),
|
|
||||||
})) {
|
|
||||||
// self.logger.print("goto: l:{d} c:{d} {any} {}", .{ line, column, sel, pos_type });
|
|
||||||
have_sel = true;
|
|
||||||
} else return error.InvalidGotoLineAndColumnArgument;
|
} else return error.InvalidGotoLineAndColumnArgument;
|
||||||
self.cancel_all_selections();
|
self.cancel_all_selections();
|
||||||
const root = self.buf_root() catch return;
|
const root = self.buf_root() catch return;
|
||||||
if (pos_type == .byte) {
|
|
||||||
column = root.pos_to_width(line - 1, column - 1, self.metrics) catch return;
|
|
||||||
column += 1;
|
|
||||||
if (have_sel) {
|
|
||||||
sel.begin.col = root.pos_to_width(sel.begin.row, sel.begin.col, self.metrics) catch return;
|
|
||||||
sel.end.col = root.pos_to_width(sel.end.row, sel.end.col, self.metrics) catch return;
|
|
||||||
}
|
|
||||||
// self.logger.print("goto_byte_pos: l:{d} c:{d} {any} {}", .{ line, column, sel, pos_type });
|
|
||||||
}
|
|
||||||
const primary = self.get_primary();
|
const primary = self.get_primary();
|
||||||
try primary.cursor.move_to(
|
try primary.cursor.move_to(
|
||||||
root,
|
root,
|
||||||
|
|
|
@ -46,7 +46,6 @@ const Entry = struct {
|
||||||
end_pos: usize,
|
end_pos: usize,
|
||||||
lines: []const u8,
|
lines: []const u8,
|
||||||
severity: editor.Diagnostic.Severity = .Information,
|
severity: editor.Diagnostic.Severity = .Information,
|
||||||
pos_type: editor.PosType,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn create(allocator: Allocator, parent: Plane) !Widget {
|
pub fn create(allocator: Allocator, parent: Plane) !Widget {
|
||||||
|
@ -251,7 +250,6 @@ fn handle_menu_action(menu: **Menu.State(*Self), button: *Button.State(*Menu.Sta
|
||||||
if (entry.begin_pos == 0) 0 else entry.begin_pos + 1,
|
if (entry.begin_pos == 0) 0 else entry.begin_pos + 1,
|
||||||
entry.end_line,
|
entry.end_line,
|
||||||
entry.end_pos + 1,
|
entry.end_pos + 1,
|
||||||
entry.pos_type,
|
|
||||||
},
|
},
|
||||||
} }) catch |e| self.logger.err("navigate", e);
|
} }) catch |e| self.logger.err("navigate", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1423,7 +1423,6 @@ fn add_find_in_files_result(
|
||||||
.end_pos = @max(1, end_pos) - 1,
|
.end_pos = @max(1, end_pos) - 1,
|
||||||
.lines = lines,
|
.lines = lines,
|
||||||
.severity = severity,
|
.severity = severity,
|
||||||
.pos_type = .byte,
|
|
||||||
}) catch |e| return tp.exit_error(e, @errorReturnTrace());
|
}) catch |e| return tp.exit_error(e, @errorReturnTrace());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue