goto_line_vim: integer parameters

This commit is contained in:
ivel.santos 2025-04-08 18:54:36 -03:00 committed by CJ van den Berg
parent f58babf2e7
commit 105be85d0f
3 changed files with 14 additions and 2 deletions

View file

@ -5057,6 +5057,18 @@ pub const Editor = struct {
}
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 {
var column: usize = 0;
if (!try ctx.args.match(.{tp.extract(&column)}))