Compare commits

..

No commits in common. "105be85d0f55916337b86ec0d6e244cf8547c2ee" and "33d4eb044a46a53fd4b68a2ee1be9e15e51ef182" have entirely different histories.

4 changed files with 32 additions and 50 deletions

View file

@ -120,7 +120,7 @@
["v", "enter_mode", "select"], ["v", "enter_mode", "select"],
["g g", "goto_line_vim"], ["g g", "move_buffer_begin"],
["g e", "move_buffer_end"], ["g e", "move_buffer_end"],
["g f", "goto_file"], ["g f", "goto_file"],
["g h", "move_begin"], ["g h", "move_begin"],
@ -225,16 +225,15 @@
["space h", "select_references_to_symbol_under_cursor"], ["space h", "select_references_to_symbol_under_cursor"],
["space c", "toggle_comment"], ["space c", "toggle_comment"],
["0", "add_integer_argument_digit", 0], ["1", "add_count", 1],
["1", "add_integer_argument_digit", 1], ["2", "add_count", 2],
["2", "add_integer_argument_digit", 2], ["3", "add_count", 3],
["3", "add_integer_argument_digit", 3], ["4", "add_count", 4],
["4", "add_integer_argument_digit", 4], ["5", "add_count", 5],
["5", "add_integer_argument_digit", 5], ["6", "add_count", 6],
["6", "add_integer_argument_digit", 6], ["7", "add_count", 7],
["7", "add_integer_argument_digit", 7], ["8", "add_count", 8],
["8", "add_integer_argument_digit", 8], ["9", "add_count", 9]
["9", "add_integer_argument_digit", 9]
] ]
}, },
"insert": { "insert": {
@ -501,16 +500,15 @@
["space h", "select_references_to_symbol_under_cursor"], ["space h", "select_references_to_symbol_under_cursor"],
["space c", "toggle_comment"], ["space c", "toggle_comment"],
["0", "add_integer_argument_digit", 0], ["1", "add_count", 1],
["1", "add_integer_argument_digit", 1], ["2", "add_count", 2],
["2", "add_integer_argument_digit", 2], ["3", "add_count", 3],
["3", "add_integer_argument_digit", 3], ["4", "add_count", 4],
["4", "add_integer_argument_digit", 4], ["5", "add_count", 5],
["5", "add_integer_argument_digit", 5], ["6", "add_count", 6],
["6", "add_integer_argument_digit", 6], ["7", "add_count", 7],
["7", "add_integer_argument_digit", 7], ["8", "add_count", 8],
["8", "add_integer_argument_digit", 8], ["9", "add_count", 9]
["9", "add_integer_argument_digit", 9]
] ]
}, },
"home": { "home": {

View file

@ -51,7 +51,7 @@
["gd", "goto_definition"], ["gd", "goto_definition"],
["gi", "goto_implementation"], ["gi", "goto_implementation"],
["gy", "goto_type_definition"], ["gy", "goto_type_definition"],
["gg", "goto_line_vim"], ["gg", "move_buffer_begin"],
["grn", "rename_symbol"], ["grn", "rename_symbol"],
["gD", "goto_declaration"], ["gD", "goto_declaration"],
["G", "move_buffer_end"], ["G", "move_buffer_end"],

View file

@ -5057,18 +5057,6 @@ pub const Editor = struct {
} }
pub const goto_line_meta: Meta = .{ .arguments = &.{.integer} }; pub const goto_line_meta: Meta = .{ .arguments = &.{.integer} };
pub fn goto_line_vim(self: *Self, ctx: Context) Result {
try self.send_editor_jump_source();
var line: usize = 0;
_ = ctx.args.match(.{tp.extract(&line)}) catch false;
const root = self.buf_root() catch return;
const primary = self.get_primary();
try primary.cursor.move_to(root, @intCast(if (line < 1) 0 else line - 1), primary.cursor.col, self.metrics);
self.clamp();
try self.send_editor_jump_destination();
}
pub const goto_line_vim_meta: Meta = .{ .arguments = &.{.integer} };
pub fn goto_column(self: *Self, ctx: Context) Result { pub fn goto_column(self: *Self, ctx: Context) Result {
var column: usize = 0; var column: usize = 0;
if (!try ctx.args.match(.{tp.extract(&column)})) if (!try ctx.args.match(.{tp.extract(&column)}))

View file

@ -78,29 +78,25 @@ const cmds_ = struct {
} }
pub const save_selection_meta: Meta = .{ .description = "Save current selection to location history" }; pub const save_selection_meta: Meta = .{ .description = "Save current selection to location history" };
pub fn extend_line_below(_: *void, ctx: Ctx) Result { pub fn extend_line_below(_: *void, _: Ctx) Result {
const mv = tui.mainview() orelse return; const mv = tui.mainview() orelse return;
const ed = mv.get_active_editor() orelse return; const ed = mv.get_active_editor() orelse return;
const root = try ed.buf_root(); const root = try ed.buf_root();
for (ed.cursels.items) |*cursel_| if (cursel_.*) |*cursel| {
const sel = cursel.enable_selection_normal();
sel.normalize();
var repeat: usize = 1; try Editor.move_cursor_begin(root, &sel.begin, ed.metrics);
_ = ctx.args.match(.{tp.extract(&repeat)}) catch false; try Editor.move_cursor_end(root, &sel.end, ed.metrics);
while (repeat > 0) : (repeat -= 1) { cursel.cursor = sel.end;
for (ed.cursels.items) |*cursel_| if (cursel_.*) |*cursel| { try cursel.selection.?.end.move_right(root, ed.metrics);
const sel = cursel.enable_selection_normal(); try cursel.cursor.move_right(root, ed.metrics);
sel.normalize(); };
try Editor.move_cursor_begin(root, &sel.begin, ed.metrics);
try Editor.move_cursor_end(root, &sel.end, ed.metrics);
cursel.cursor = sel.end;
try cursel.selection.?.end.move_right(root, ed.metrics);
try cursel.cursor.move_right(root, ed.metrics);
};
}
ed.clamp(); ed.clamp();
} }
pub const extend_line_below_meta: Meta = .{ .arguments = &.{.integer}, .description = "Select current line, if already selected, extend to next line" }; pub const extend_line_below_meta: Meta = .{ .description = "Select current line, if already selected, extend to next line" };
pub fn move_next_word_start(_: *void, ctx: Ctx) Result { pub fn move_next_word_start(_: *void, ctx: Ctx) Result {
const mv = tui.mainview() orelse return; const mv = tui.mainview() orelse return;