mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-31 19:05:00 +07:00
vim: Add test for helix selection duplication issue
This commit is contained in:
parent
bc41407a5e
commit
3342d27003
1 changed files with 48 additions and 0 deletions
|
|
@ -147,6 +147,8 @@ fn display_point_range_to_offset_range(
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use db::indoc;
|
||||
use gpui::{AppContext, UpdateGlobal};
|
||||
use settings::SettingsStore;
|
||||
|
||||
use crate::{state::Mode, test::VimTestContext};
|
||||
|
||||
|
|
@ -310,4 +312,50 @@ mod tests {
|
|||
Mode::HelixNormal,
|
||||
);
|
||||
}
|
||||
|
||||
#[gpui::test]
|
||||
async fn test_selection_duplication_softwrap(cx: &mut gpui::TestAppContext) {
|
||||
let mut cx = VimTestContext::new(cx, true).await;
|
||||
|
||||
cx.enable_helix();
|
||||
cx.update_global(|settings: &mut SettingsStore, cx| {
|
||||
settings.update_user_settings(cx, |settings| {
|
||||
settings.project.all_languages.defaults.soft_wrap =
|
||||
Some(settings::SoftWrap::Bounded);
|
||||
settings
|
||||
.project
|
||||
.all_languages
|
||||
.defaults
|
||||
.preferred_line_length = Some(8);
|
||||
});
|
||||
});
|
||||
|
||||
cx.set_state(
|
||||
indoc! {"
|
||||
The quick brown
|
||||
foˇx jumps over the
|
||||
lazy dog."},
|
||||
Mode::HelixNormal,
|
||||
);
|
||||
|
||||
cx.simulate_keystrokes("C");
|
||||
|
||||
cx.assert_state(
|
||||
indoc! {"
|
||||
The quick brown
|
||||
foˇx jumps over the
|
||||
laˇzy dog."},
|
||||
Mode::HelixNormal,
|
||||
);
|
||||
|
||||
cx.simulate_keystrokes("alt-C");
|
||||
|
||||
cx.assert_state(
|
||||
indoc! {"
|
||||
Thˇe quick brown
|
||||
foˇx jumps over the
|
||||
laˇzy dog."},
|
||||
Mode::HelixNormal,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue