This commit is contained in:
Conrad Irwin 2023-09-07 10:51:18 -06:00
parent 1b1d7f22cc
commit 48bb2a3321
2 changed files with 15 additions and 1 deletions

View file

@ -327,7 +327,7 @@
"Delete" "Delete"
], ],
"shift-d": "vim::DeleteToEndOfLine", "shift-d": "vim::DeleteToEndOfLine",
"shift-j": "editor::JoinLines", "shift-j": "vim::JoinLines",
"y": [ "y": [
"vim::PushOperator", "vim::PushOperator",
"Yank" "Yank"

View file

@ -46,6 +46,7 @@ actions!(
DeleteToEndOfLine, DeleteToEndOfLine,
Yank, Yank,
ChangeCase, ChangeCase,
JoinLines,
] ]
); );
@ -106,6 +107,19 @@ pub fn init(cx: &mut AppContext) {
); );
}) })
}); });
cx.add_action(|_: &mut Workspace, _: &JoinLines, cx| {
Vim::update(cx, |vim, cx| {
vim.record_current_action(cx);
let times = vim.pop_number_operator(cx).unwrap_or(1);
vim.update_active_editor(cx, |editor, cx| {
editor.transact(cx, |editor, cx| {
for _ in 0..times {
editor.join_lines(editor::JoinLines, cx)
}
})
})
})
})
} }
pub fn normal_motion( pub fn normal_motion(