Fix - being a word character for selections (#17171)

Co-Authored-By: Mikayla <mikayla@zed.dev>
Co-Authored-By: Nate <nate@zed.dev>

Closes #15606
Closes #13515

Release Notes:

- Fixes `-` being considered a word character for selections in some
languages

Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Nate <nate@zed.dev>
This commit is contained in:
Conrad Irwin 2024-08-30 12:34:23 -06:00 committed by GitHub
parent c0731bfa28
commit ee6ec50b15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 239 additions and 143 deletions

View file

@ -305,6 +305,25 @@ async fn test_word_characters(cx: &mut gpui::TestAppContext) {
)
}
#[gpui::test]
async fn test_kebab_case(cx: &mut gpui::TestAppContext) {
let mut cx = VimTestContext::new_html(cx).await;
cx.set_state(
indoc! { r#"
<div><a class="bg-rˇed"></a></div>
"#},
Mode::Normal,
);
cx.simulate_keystrokes("v i w");
cx.assert_state(
indoc! { r#"
<div><a class="bg-«redˇ»"></a></div>
"#
},
Mode::Visual,
)
}
#[gpui::test]
async fn test_join_lines(cx: &mut gpui::TestAppContext) {
let mut cx = NeovimBackedTestContext::new(cx).await;