Compare commits

..

No commits in common. "ec783d68a61bfec99cf276da6158866ab31e2875" and "fc8642768d5b61dd414b8252ae3d9b5bae5e9b50" have entirely different histories.

2 changed files with 13 additions and 46 deletions

View file

@ -25,7 +25,6 @@
["alt+x", "open_command_palette"],
["f4", "toggle_input_mode"],
["ctrl+f2", "insert_command_name"],
["ctrl+k ctrl+s", "insert_command_name"],
["f9", "theme_prev"],
["f10", "theme_next"],
["f11", "toggle_panel"],
@ -169,6 +168,8 @@
["alt+}", "shrink_selection", true],
["alt+[", "select_prev_sibling", true],
["alt+]", "select_next_sibling", true],
["alt+shift+e", "move_parent_node_end"],
["alt+shift+b", "move_parent_node_start"],
["alt+a", "select_all_siblings"],
["alt+shift+home", "move_scroll_left"],
["alt+shift+end", "move_scroll_right"],
@ -201,7 +202,6 @@
["shift+enter", "smart_insert_line_before"],
["shift+backspace", "delete_backward"],
["ctrl+shift+k", "delete_line"],
["alt+shift+e", "select_line"],
["shift+tab", "unindent"],
["f2", "rename_symbol"],
["f3", "goto_next_match"],

View file

@ -3015,41 +3015,9 @@ pub const Editor = struct {
}
pub const delete_to_end_meta: Meta = .{ .description = "Delete to end of line" };
pub fn select_line(self: *Self, ctx: Context) Result {
const root = try self.buf_root();
var repeat: usize = 1;
_ = ctx.args.match(.{tp.extract(&repeat)}) catch false;
while (repeat > 0) : (repeat -= 1) {
for (self.cursels.items) |*cursel_| if (cursel_.*) |*cursel| {
if (cursel.selection) |*sel| {
sel.normalize();
move_cursor_begin(root, &sel.begin, self.metrics) catch {};
move_cursor_end(root, &sel.end, self.metrics) catch {};
blk: {
cursel.cursor.move_down(root, self.metrics) catch |e| switch (e) {
error.Stop => {
cursel.cursor.move_end(root, self.metrics);
break :blk;
},
};
move_cursor_begin(root, &cursel.cursor, self.metrics) catch {};
}
sel.end = cursel.cursor;
} else {
self.select_line_at_cursor(root, cursel, .include_eol) catch {};
}
};
self.collapse_cursors();
}
}
pub const select_line_meta: Meta = .{ .description = "Select current line", .arguments = &.{.integer} };
pub fn delete_line(self: *Self, ctx: Context) Result {
pub fn delete_line(self: *Self, _: Context) Result {
const b = try self.buf_for_update();
var root = b.root;
var repeat: usize = 1;
_ = ctx.args.match(.{tp.extract(&repeat)}) catch false;
while (repeat > 0) : (repeat -= 1) {
for (self.cursels.items) |*cursel_| if (cursel_.*) |*cursel| {
const col = cursel.cursor.col;
const target = cursel.cursor.target;
@ -3059,11 +3027,10 @@ pub const Editor = struct {
cursel.cursor.target = target;
cursel.cursor.clamp_to_buffer(root, self.metrics);
};
}
try self.update_buf(root);
self.clamp();
}
pub const delete_line_meta: Meta = .{ .description = "Delete current line", .arguments = &.{.integer} };
pub const delete_line_meta: Meta = .{ .description = "Delete current line" };
pub fn cut_to_end_vim(self: *Self, _: Context) Result {
const b = try self.buf_for_update();