Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix character selection
Conrad Irwin0e035c1a95d4
diff --git a/crates/editor/src/movement.rs b/crates/editor/src/movement.rsindex 580faf10506..5b780095d6d 100644--- a/crates/editor/src/movement.rs+++ b/crates/editor/src/movement.rs@@ -707,7 +707,9 @@ mod tests {let (snapshot, display_points) = marked_display_snapshot(marked_text, cx);assert_eq!(surrounding_word(&snapshot, display_points[1]),- display_points[0]..display_points[2]+ display_points[0]..display_points[2],+ "{}",+ marked_text.to_string());}@@ -717,7 +719,7 @@ mod tests {assert("loremˇ ˇ ˇipsum", cx);assert("lorem\nˇˇˇ\nipsum", cx);assert("lorem\nˇˇipsumˇ", cx);- assert("lorem,ˇˇ ˇipsum", cx);+ assert("loremˇ,ˇˇ ipsum", cx);assert("ˇloremˇˇ, ipsum", cx);}diff --git a/crates/language/src/buffer.rs b/crates/language/src/buffer.rsindex 063c7616a8d..0194123bd23 100644--- a/crates/language/src/buffer.rs+++ b/crates/language/src/buffer.rs@@ -373,8 +373,8 @@ pub(crate) struct DiagnosticEndpoint {#[derive(Copy, Clone, Eq, PartialEq, PartialOrd, Ord, Debug)]pub enum CharKind {- Punctuation,Whitespace,+ Punctuation,Word,}diff --git a/crates/vim/src/test.rs b/crates/vim/src/test.rsindex 3b4e2fed600..9a6976183b8 100644--- a/crates/vim/src/test.rs+++ b/crates/vim/src/test.rs@@ -748,11 +748,10 @@ async fn test_select_all_issue_2170(cx: &mut gpui::TestAppContext) {Mode::Normal,);cx.simulate_keystrokes(["g", "a"]);- // TODO: this would be better if it selected the [ not the space.cx.assert_state(indoc! {"- defmodule« ˇ»Test« ˇ»do- « ˇ»def« ˇ»test(a,« ˇ»[_,« ˇ»_]« ˇ»=« ˇ»b),« ˇ»do:« ˇ»IO.puts('hi')+ defmodule Test do+ def test(a, «[ˇ»_, _] = b), do: IO.puts('hi')end"},Mode::Visual,