Simulate helix line wrapping (#32763)
In helix the `f`, `F`, `t`, `T`, left and right motions wrap lines. I added that by default. Release Notes: - vim: The `use_multiline_find` setting is replaced by binding to the correct action in the keymap: ``` "f": ["vim::PushFindForward", { "before": false, "multiline": true }], "t": ["vim::PushFindForward", { "before": true, "multiline": true }], "shift-f": ["vim::PushFindBackward", { "after": false, "multiline": true }], "shift-t": ["vim::PushFindBackward", { "after": true, "multiline": true }], ``` - helix: `f`/`t`/`shift-f`/`shift-t`/`h`/`l`/`left`/`right` are now multiline by default (like helix)
This commit is contained in:
parent
7be57baef0
commit
95cf153ad7
7 changed files with 60 additions and 104 deletions
|
@ -1532,90 +1532,6 @@ mod test {
|
|||
}
|
||||
}
|
||||
|
||||
#[gpui::test]
|
||||
async fn test_f_and_t_multiline(cx: &mut gpui::TestAppContext) {
|
||||
let mut cx = VimTestContext::new(cx, true).await;
|
||||
cx.update_global(|store: &mut SettingsStore, cx| {
|
||||
store.update_user_settings::<VimSettings>(cx, |s| {
|
||||
s.use_multiline_find = Some(true);
|
||||
});
|
||||
});
|
||||
|
||||
cx.assert_binding(
|
||||
"f l",
|
||||
indoc! {"
|
||||
ˇfunction print() {
|
||||
console.log('ok')
|
||||
}
|
||||
"},
|
||||
Mode::Normal,
|
||||
indoc! {"
|
||||
function print() {
|
||||
consoˇle.log('ok')
|
||||
}
|
||||
"},
|
||||
Mode::Normal,
|
||||
);
|
||||
|
||||
cx.assert_binding(
|
||||
"t l",
|
||||
indoc! {"
|
||||
ˇfunction print() {
|
||||
console.log('ok')
|
||||
}
|
||||
"},
|
||||
Mode::Normal,
|
||||
indoc! {"
|
||||
function print() {
|
||||
consˇole.log('ok')
|
||||
}
|
||||
"},
|
||||
Mode::Normal,
|
||||
);
|
||||
}
|
||||
|
||||
#[gpui::test]
|
||||
async fn test_capital_f_and_capital_t_multiline(cx: &mut gpui::TestAppContext) {
|
||||
let mut cx = VimTestContext::new(cx, true).await;
|
||||
cx.update_global(|store: &mut SettingsStore, cx| {
|
||||
store.update_user_settings::<VimSettings>(cx, |s| {
|
||||
s.use_multiline_find = Some(true);
|
||||
});
|
||||
});
|
||||
|
||||
cx.assert_binding(
|
||||
"shift-f p",
|
||||
indoc! {"
|
||||
function print() {
|
||||
console.ˇlog('ok')
|
||||
}
|
||||
"},
|
||||
Mode::Normal,
|
||||
indoc! {"
|
||||
function ˇprint() {
|
||||
console.log('ok')
|
||||
}
|
||||
"},
|
||||
Mode::Normal,
|
||||
);
|
||||
|
||||
cx.assert_binding(
|
||||
"shift-t p",
|
||||
indoc! {"
|
||||
function print() {
|
||||
console.ˇlog('ok')
|
||||
}
|
||||
"},
|
||||
Mode::Normal,
|
||||
indoc! {"
|
||||
function pˇrint() {
|
||||
console.log('ok')
|
||||
}
|
||||
"},
|
||||
Mode::Normal,
|
||||
);
|
||||
}
|
||||
|
||||
#[gpui::test]
|
||||
async fn test_f_and_t_smartcase(cx: &mut gpui::TestAppContext) {
|
||||
let mut cx = VimTestContext::new(cx, true).await;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue