Update vim mode tests to use new marked text format
This commit is contained in:
parent
eabd9c02e5
commit
afcf5fc95b
7 changed files with 491 additions and 485 deletions
|
@ -1,33 +1,28 @@
|
||||||
use std::{
|
|
||||||
any::TypeId,
|
|
||||||
ops::{Deref, DerefMut, Range},
|
|
||||||
sync::Arc,
|
|
||||||
};
|
|
||||||
|
|
||||||
use anyhow::Result;
|
|
||||||
use futures::{Future, StreamExt};
|
|
||||||
use indoc::indoc;
|
|
||||||
|
|
||||||
use gpui::{
|
|
||||||
json, keymap::Keystroke, AppContext, ModelContext, ModelHandle, ViewContext, ViewHandle,
|
|
||||||
};
|
|
||||||
use language::{
|
|
||||||
point_to_lsp, Buffer, BufferSnapshot, FakeLspAdapter, Language, LanguageConfig, Selection,
|
|
||||||
};
|
|
||||||
use lsp::{notification, request};
|
|
||||||
use project::Project;
|
|
||||||
use settings::Settings;
|
|
||||||
use util::{
|
|
||||||
assert_set_eq, set_eq,
|
|
||||||
test::{generate_marked_text, marked_text, parse_marked_text},
|
|
||||||
};
|
|
||||||
use workspace::{pane, AppState, Workspace, WorkspaceHandle};
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
display_map::{DisplayMap, DisplaySnapshot, ToDisplayPoint},
|
display_map::{DisplayMap, DisplaySnapshot, ToDisplayPoint},
|
||||||
multi_buffer::ToPointUtf16,
|
multi_buffer::ToPointUtf16,
|
||||||
AnchorRangeExt, Autoscroll, DisplayPoint, Editor, EditorMode, MultiBuffer, ToPoint,
|
AnchorRangeExt, Autoscroll, DisplayPoint, Editor, EditorMode, MultiBuffer, ToPoint,
|
||||||
};
|
};
|
||||||
|
use anyhow::Result;
|
||||||
|
use futures::{Future, StreamExt};
|
||||||
|
use gpui::{
|
||||||
|
json, keymap::Keystroke, AppContext, ModelContext, ModelHandle, ViewContext, ViewHandle,
|
||||||
|
};
|
||||||
|
use indoc::indoc;
|
||||||
|
use language::{point_to_lsp, Buffer, BufferSnapshot, FakeLspAdapter, Language, LanguageConfig};
|
||||||
|
use lsp::{notification, request};
|
||||||
|
use project::Project;
|
||||||
|
use settings::Settings;
|
||||||
|
use std::{
|
||||||
|
any::TypeId,
|
||||||
|
ops::{Deref, DerefMut, Range},
|
||||||
|
sync::Arc,
|
||||||
|
};
|
||||||
|
use util::{
|
||||||
|
assert_set_eq, set_eq,
|
||||||
|
test::{generate_marked_text, marked_text, parse_marked_text},
|
||||||
|
};
|
||||||
|
use workspace::{pane, AppState, Workspace, WorkspaceHandle};
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[ctor::ctor]
|
#[ctor::ctor]
|
||||||
|
@ -258,11 +253,7 @@ impl<'a> EditorTestContext<'a> {
|
||||||
assert_set_eq!(actual_ranges, expected_ranges);
|
assert_set_eq!(actual_ranges, expected_ranges);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn assert_editor_selections(&mut self, expected_selections: Vec<Selection<usize>>) {
|
pub fn assert_editor_selections(&mut self, expected_selections: Vec<Range<usize>>) {
|
||||||
let expected_selections = expected_selections
|
|
||||||
.into_iter()
|
|
||||||
.map(|s| s.range())
|
|
||||||
.collect::<Vec<_>>();
|
|
||||||
let expected_marked_text =
|
let expected_marked_text =
|
||||||
generate_marked_text(&self.buffer_text(), &expected_selections, true);
|
generate_marked_text(&self.buffer_text(), &expected_selections, true);
|
||||||
self.assert_selections(expected_selections, expected_marked_text)
|
self.assert_selections(expected_selections, expected_marked_text)
|
||||||
|
@ -277,7 +268,13 @@ impl<'a> EditorTestContext<'a> {
|
||||||
.editor
|
.editor
|
||||||
.read_with(self.cx, |editor, cx| editor.selections.all::<usize>(cx))
|
.read_with(self.cx, |editor, cx| editor.selections.all::<usize>(cx))
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|s| s.range())
|
.map(|s| {
|
||||||
|
if s.reversed {
|
||||||
|
s.end..s.start
|
||||||
|
} else {
|
||||||
|
s.start..s.end
|
||||||
|
}
|
||||||
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
let actual_marked_text =
|
let actual_marked_text =
|
||||||
generate_marked_text(&self.buffer_text(), &actual_selections, true);
|
generate_marked_text(&self.buffer_text(), &actual_selections, true);
|
||||||
|
@ -285,11 +282,13 @@ impl<'a> EditorTestContext<'a> {
|
||||||
panic!(
|
panic!(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Editor has unexpected selections.
|
Editor has unexpected selections.
|
||||||
|
|
||||||
Expected selections:
|
Expected selections:
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Actual selections:
|
Actual selections:
|
||||||
{}",
|
{}
|
||||||
},
|
"},
|
||||||
expected_marked_text, actual_marked_text,
|
expected_marked_text, actual_marked_text,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,9 +34,9 @@ mod test {
|
||||||
cx.simulate_keystroke("i");
|
cx.simulate_keystroke("i");
|
||||||
assert_eq!(cx.mode(), Mode::Insert);
|
assert_eq!(cx.mode(), Mode::Insert);
|
||||||
cx.simulate_keystrokes(["T", "e", "s", "t"]);
|
cx.simulate_keystrokes(["T", "e", "s", "t"]);
|
||||||
cx.assert_editor_state("Test|");
|
cx.assert_editor_state("Testˇ");
|
||||||
cx.simulate_keystroke("escape");
|
cx.simulate_keystroke("escape");
|
||||||
assert_eq!(cx.mode(), Mode::Normal);
|
assert_eq!(cx.mode(), Mode::Normal);
|
||||||
cx.assert_editor_state("Tes|t");
|
cx.assert_editor_state("Tesˇt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -297,7 +297,6 @@ fn paste(_: &mut Workspace, _: &Paste, cx: &mut ViewContext<Workspace>) {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use indoc::indoc;
|
use indoc::indoc;
|
||||||
use language::Selection;
|
|
||||||
use util::test::marked_text;
|
use util::test::marked_text;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -312,15 +311,15 @@ mod test {
|
||||||
async fn test_h(cx: &mut gpui::TestAppContext) {
|
async fn test_h(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["h"]);
|
let mut cx = cx.binding(["h"]);
|
||||||
cx.assert("The q|uick", "The |quick");
|
cx.assert("The qˇuick", "The ˇquick");
|
||||||
cx.assert("|The quick", "|The quick");
|
cx.assert("ˇThe quick", "ˇThe quick");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|brown"},
|
ˇbrown"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|brown"},
|
ˇbrown"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,15 +327,15 @@ mod test {
|
||||||
async fn test_backspace(cx: &mut gpui::TestAppContext) {
|
async fn test_backspace(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["backspace"]);
|
let mut cx = cx.binding(["backspace"]);
|
||||||
cx.assert("The q|uick", "The |quick");
|
cx.assert("The qˇuick", "The ˇquick");
|
||||||
cx.assert("|The quick", "|The quick");
|
cx.assert("ˇThe quick", "ˇThe quick");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|brown"},
|
ˇbrown"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|brown"},
|
ˇbrown"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -346,35 +345,35 @@ mod test {
|
||||||
let mut cx = cx.binding(["j"]);
|
let mut cx = cx.binding(["j"]);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick
|
The ˇquick
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brow|n fox"},
|
browˇn fox"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brow|n fox"},
|
browˇn fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brow|n fox"},
|
browˇn fox"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quic|k
|
The quicˇk
|
||||||
brown"},
|
brown"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brow|n"},
|
browˇn"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|brown"},
|
ˇbrown"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|brown"},
|
ˇbrown"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,26 +383,26 @@ mod test {
|
||||||
let mut cx = cx.binding(["k"]);
|
let mut cx = cx.binding(["k"]);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick
|
The ˇquick
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick
|
The ˇquick
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brow|n fox"},
|
browˇn fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick
|
The ˇquick
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The
|
The
|
||||||
quic|k"},
|
quicˇk"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Th|e
|
Thˇe
|
||||||
quick"},
|
quick"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -412,14 +411,14 @@ mod test {
|
||||||
async fn test_l(cx: &mut gpui::TestAppContext) {
|
async fn test_l(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["l"]);
|
let mut cx = cx.binding(["l"]);
|
||||||
cx.assert("The q|uick", "The qu|ick");
|
cx.assert("The qˇuick", "The quˇick");
|
||||||
cx.assert("The quic|k", "The quic|k");
|
cx.assert("The quicˇk", "The quicˇk");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quic|k
|
The quicˇk
|
||||||
brown"},
|
brown"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quic|k
|
The quicˇk
|
||||||
brown"},
|
brown"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -428,42 +427,42 @@ mod test {
|
||||||
async fn test_jump_to_line_boundaries(cx: &mut gpui::TestAppContext) {
|
async fn test_jump_to_line_boundaries(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["$"]);
|
let mut cx = cx.binding(["$"]);
|
||||||
cx.assert("T|est test", "Test tes|t");
|
cx.assert("Tˇest test", "Test tesˇt");
|
||||||
cx.assert("Test tes|t", "Test tes|t");
|
cx.assert("Test tesˇt", "Test tesˇt");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick
|
The ˇquick
|
||||||
brown"},
|
brown"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quic|k
|
The quicˇk
|
||||||
brown"},
|
brown"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quic|k
|
The quicˇk
|
||||||
brown"},
|
brown"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quic|k
|
The quicˇk
|
||||||
brown"},
|
brown"},
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut cx = cx.binding(["0"]);
|
let mut cx = cx.binding(["0"]);
|
||||||
cx.assert("Test |test", "|Test test");
|
cx.assert("Test ˇtest", "ˇTest test");
|
||||||
cx.assert("|Test test", "|Test test");
|
cx.assert("ˇTest test", "ˇTest test");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick
|
The ˇquick
|
||||||
brown"},
|
brown"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|The quick
|
ˇThe quick
|
||||||
brown"},
|
brown"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|The quick
|
ˇThe quick
|
||||||
brown"},
|
brown"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|The quick
|
ˇThe quick
|
||||||
brown"},
|
brown"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -475,7 +474,7 @@ mod test {
|
||||||
|
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick
|
The ˇquick
|
||||||
|
|
||||||
brown fox jumps
|
brown fox jumps
|
||||||
over the lazy dog"},
|
over the lazy dog"},
|
||||||
|
@ -483,39 +482,39 @@ mod test {
|
||||||
The quick
|
The quick
|
||||||
|
|
||||||
brown fox jumps
|
brown fox jumps
|
||||||
over| the lazy dog"},
|
overˇ the lazy dog"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
||||||
brown fox jumps
|
brown fox jumps
|
||||||
over| the lazy dog"},
|
overˇ the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
||||||
brown fox jumps
|
brown fox jumps
|
||||||
over| the lazy dog"},
|
overˇ the lazy dog"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The qui|ck
|
The quiˇck
|
||||||
|
|
||||||
brown"},
|
brown"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
||||||
brow|n"},
|
browˇn"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The qui|ck
|
The quiˇck
|
||||||
|
|
||||||
"},
|
"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
||||||
|"},
|
ˇ"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -523,14 +522,14 @@ mod test {
|
||||||
async fn test_w(cx: &mut gpui::TestAppContext) {
|
async fn test_w(cx: &mut gpui::TestAppContext) {
|
||||||
let mut cx = VimTestContext::new(cx, true).await;
|
let mut cx = VimTestContext::new(cx, true).await;
|
||||||
let (_, cursor_offsets) = marked_text(indoc! {"
|
let (_, cursor_offsets) = marked_text(indoc! {"
|
||||||
The |quick|-|brown
|
The ˇquickˇ-ˇbrown
|
||||||
|
|
ˇ
|
||||||
|
|
ˇ
|
||||||
|fox_jumps |over
|
ˇfox_jumps ˇover
|
||||||
|th||e"});
|
ˇthˇˇe"});
|
||||||
cx.set_state(
|
cx.set_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|The quick-brown
|
ˇThe quick-brown
|
||||||
|
|
||||||
|
|
||||||
fox_jumps over
|
fox_jumps over
|
||||||
|
@ -540,19 +539,19 @@ mod test {
|
||||||
|
|
||||||
for cursor_offset in cursor_offsets {
|
for cursor_offset in cursor_offsets {
|
||||||
cx.simulate_keystroke("w");
|
cx.simulate_keystroke("w");
|
||||||
cx.assert_editor_selections(vec![Selection::from_offset(cursor_offset)]);
|
cx.assert_editor_selections(vec![cursor_offset..cursor_offset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset and test ignoring punctuation
|
// Reset and test ignoring punctuation
|
||||||
let (_, cursor_offsets) = marked_text(indoc! {"
|
let (_, cursor_offsets) = marked_text(indoc! {"
|
||||||
The |quick-brown
|
The ˇquick-brown
|
||||||
|
|
ˇ
|
||||||
|
|
ˇ
|
||||||
|fox_jumps |over
|
ˇfox_jumps ˇover
|
||||||
|th||e"});
|
ˇthˇˇe"});
|
||||||
cx.set_state(
|
cx.set_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|The quick-brown
|
ˇThe quick-brown
|
||||||
|
|
||||||
|
|
||||||
fox_jumps over
|
fox_jumps over
|
||||||
|
@ -562,7 +561,7 @@ mod test {
|
||||||
|
|
||||||
for cursor_offset in cursor_offsets {
|
for cursor_offset in cursor_offsets {
|
||||||
cx.simulate_keystroke("shift-w");
|
cx.simulate_keystroke("shift-w");
|
||||||
cx.assert_editor_selections(vec![Selection::from_offset(cursor_offset)]);
|
cx.assert_editor_selections(vec![cursor_offset..cursor_offset]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -570,14 +569,14 @@ mod test {
|
||||||
async fn test_e(cx: &mut gpui::TestAppContext) {
|
async fn test_e(cx: &mut gpui::TestAppContext) {
|
||||||
let mut cx = VimTestContext::new(cx, true).await;
|
let mut cx = VimTestContext::new(cx, true).await;
|
||||||
let (_, cursor_offsets) = marked_text(indoc! {"
|
let (_, cursor_offsets) = marked_text(indoc! {"
|
||||||
Th|e quic|k|-brow|n
|
Thˇe quicˇkˇ-browˇn
|
||||||
|
|
||||||
|
|
||||||
fox_jump|s ove|r
|
fox_jumpˇs oveˇr
|
||||||
th|e"});
|
thˇe"});
|
||||||
cx.set_state(
|
cx.set_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|The quick-brown
|
ˇThe quick-brown
|
||||||
|
|
||||||
|
|
||||||
fox_jumps over
|
fox_jumps over
|
||||||
|
@ -587,19 +586,19 @@ mod test {
|
||||||
|
|
||||||
for cursor_offset in cursor_offsets {
|
for cursor_offset in cursor_offsets {
|
||||||
cx.simulate_keystroke("e");
|
cx.simulate_keystroke("e");
|
||||||
cx.assert_editor_selections(vec![Selection::from_offset(cursor_offset)]);
|
cx.assert_editor_selections(vec![cursor_offset..cursor_offset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset and test ignoring punctuation
|
// Reset and test ignoring punctuation
|
||||||
let (_, cursor_offsets) = marked_text(indoc! {"
|
let (_, cursor_offsets) = marked_text(indoc! {"
|
||||||
Th|e quick-brow|n
|
Thˇe quick-browˇn
|
||||||
|
|
||||||
|
|
||||||
fox_jump|s ove|r
|
fox_jumpˇs oveˇr
|
||||||
th||e"});
|
thˇˇe"});
|
||||||
cx.set_state(
|
cx.set_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|The quick-brown
|
ˇThe quick-brown
|
||||||
|
|
||||||
|
|
||||||
fox_jumps over
|
fox_jumps over
|
||||||
|
@ -608,7 +607,7 @@ mod test {
|
||||||
);
|
);
|
||||||
for cursor_offset in cursor_offsets {
|
for cursor_offset in cursor_offsets {
|
||||||
cx.simulate_keystroke("shift-e");
|
cx.simulate_keystroke("shift-e");
|
||||||
cx.assert_editor_selections(vec![Selection::from_offset(cursor_offset)]);
|
cx.assert_editor_selections(vec![cursor_offset..cursor_offset]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -616,45 +615,45 @@ mod test {
|
||||||
async fn test_b(cx: &mut gpui::TestAppContext) {
|
async fn test_b(cx: &mut gpui::TestAppContext) {
|
||||||
let mut cx = VimTestContext::new(cx, true).await;
|
let mut cx = VimTestContext::new(cx, true).await;
|
||||||
let (_, cursor_offsets) = marked_text(indoc! {"
|
let (_, cursor_offsets) = marked_text(indoc! {"
|
||||||
||The |quick|-|brown
|
ˇˇThe ˇquickˇ-ˇbrown
|
||||||
|
|
ˇ
|
||||||
|
|
ˇ
|
||||||
|fox_jumps |over
|
ˇfox_jumps ˇover
|
||||||
|the"});
|
ˇthe"});
|
||||||
cx.set_state(
|
cx.set_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick-brown
|
The quick-brown
|
||||||
|
|
||||||
|
|
||||||
fox_jumps over
|
fox_jumps over
|
||||||
th|e"},
|
thˇe"},
|
||||||
Mode::Normal,
|
Mode::Normal,
|
||||||
);
|
);
|
||||||
|
|
||||||
for cursor_offset in cursor_offsets.into_iter().rev() {
|
for cursor_offset in cursor_offsets.into_iter().rev() {
|
||||||
cx.simulate_keystroke("b");
|
cx.simulate_keystroke("b");
|
||||||
cx.assert_editor_selections(vec![Selection::from_offset(cursor_offset)]);
|
cx.assert_editor_selections(vec![cursor_offset..cursor_offset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset and test ignoring punctuation
|
// Reset and test ignoring punctuation
|
||||||
let (_, cursor_offsets) = marked_text(indoc! {"
|
let (_, cursor_offsets) = marked_text(indoc! {"
|
||||||
||The |quick-brown
|
ˇˇThe ˇquick-brown
|
||||||
|
|
ˇ
|
||||||
|
|
ˇ
|
||||||
|fox_jumps |over
|
ˇfox_jumps ˇover
|
||||||
|the"});
|
ˇthe"});
|
||||||
cx.set_state(
|
cx.set_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick-brown
|
The quick-brown
|
||||||
|
|
||||||
|
|
||||||
fox_jumps over
|
fox_jumps over
|
||||||
th|e"},
|
thˇe"},
|
||||||
Mode::Normal,
|
Mode::Normal,
|
||||||
);
|
);
|
||||||
for cursor_offset in cursor_offsets.into_iter().rev() {
|
for cursor_offset in cursor_offsets.into_iter().rev() {
|
||||||
cx.simulate_keystroke("shift-b");
|
cx.simulate_keystroke("shift-b");
|
||||||
cx.assert_editor_selections(vec![Selection::from_offset(cursor_offset)]);
|
cx.assert_editor_selections(vec![cursor_offset..cursor_offset]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -683,21 +682,21 @@ mod test {
|
||||||
The quick
|
The quick
|
||||||
|
|
||||||
brown fox jumps
|
brown fox jumps
|
||||||
over |the lazy dog"},
|
over ˇthe lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
|
|
||||||
brown fox jumps
|
brown fox jumps
|
||||||
over the lazy dog"},
|
over the lazy dog"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
|
|
||||||
brown fox jumps
|
brown fox jumps
|
||||||
over the lazy dog"},
|
over the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
|
|
||||||
brown fox jumps
|
brown fox jumps
|
||||||
over the lazy dog"},
|
over the lazy dog"},
|
||||||
|
@ -707,9 +706,9 @@ mod test {
|
||||||
The quick
|
The quick
|
||||||
|
|
||||||
brown fox jumps
|
brown fox jumps
|
||||||
over the la|zy dog"},
|
over the laˇzy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quic|k
|
The quicˇk
|
||||||
|
|
||||||
brown fox jumps
|
brown fox jumps
|
||||||
over the lazy dog"},
|
over the lazy dog"},
|
||||||
|
@ -719,9 +718,9 @@ mod test {
|
||||||
|
|
||||||
|
|
||||||
brown fox jumps
|
brown fox jumps
|
||||||
over the la|zy dog"},
|
over the laˇzy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
|
|
||||||
brown fox jumps
|
brown fox jumps
|
||||||
over the lazy dog"},
|
over the lazy dog"},
|
||||||
|
@ -733,31 +732,31 @@ mod test {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["a"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["a"]).mode_after(Mode::Insert);
|
||||||
|
|
||||||
cx.assert("The q|uick", "The qu|ick");
|
cx.assert("The qˇuick", "The quˇick");
|
||||||
cx.assert("The quic|k", "The quick|");
|
cx.assert("The quicˇk", "The quickˇ");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpui::test]
|
#[gpui::test]
|
||||||
async fn test_insert_end_of_line(cx: &mut gpui::TestAppContext) {
|
async fn test_insert_end_of_line(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["shift-a"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["shift-a"]).mode_after(Mode::Insert);
|
||||||
cx.assert("The q|uick", "The quick|");
|
cx.assert("The qˇuick", "The quickˇ");
|
||||||
cx.assert("The q|uick ", "The quick |");
|
cx.assert("The qˇuick ", "The quick ˇ");
|
||||||
cx.assert("|", "|");
|
cx.assert("ˇ", "ˇ");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick|
|
The quickˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
The quick"},
|
The quick"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
The quick"},
|
The quick"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -766,50 +765,50 @@ mod test {
|
||||||
async fn test_jump_to_first_non_whitespace(cx: &mut gpui::TestAppContext) {
|
async fn test_jump_to_first_non_whitespace(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["^"]);
|
let mut cx = cx.binding(["^"]);
|
||||||
cx.assert("The q|uick", "|The quick");
|
cx.assert("The qˇuick", "ˇThe quick");
|
||||||
cx.assert(" The q|uick", " |The quick");
|
cx.assert(" The qˇuick", " ˇThe quick");
|
||||||
cx.assert("|", "|");
|
cx.assert("ˇ", "ˇ");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|The quick
|
ˇThe quick
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
The quick"},
|
The quick"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
The quick"},
|
The quick"},
|
||||||
);
|
);
|
||||||
// Indoc disallows trailing whitspace.
|
// Indoc disallows trailing whitspace.
|
||||||
cx.assert(" | \nThe quick", " | \nThe quick");
|
cx.assert(" ˇ \nThe quick", " ˇ \nThe quick");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpui::test]
|
#[gpui::test]
|
||||||
async fn test_insert_first_non_whitespace(cx: &mut gpui::TestAppContext) {
|
async fn test_insert_first_non_whitespace(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["shift-i"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["shift-i"]).mode_after(Mode::Insert);
|
||||||
cx.assert("The q|uick", "|The quick");
|
cx.assert("The qˇuick", "ˇThe quick");
|
||||||
cx.assert(" The q|uick", " |The quick");
|
cx.assert(" The qˇuick", " ˇThe quick");
|
||||||
cx.assert("|", "|");
|
cx.assert("ˇ", "ˇ");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|The quick
|
ˇThe quick
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
The quick"},
|
The quick"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
The quick"},
|
The quick"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -820,20 +819,20 @@ mod test {
|
||||||
let mut cx = cx.binding(["shift-d"]);
|
let mut cx = cx.binding(["shift-d"]);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |q
|
The ˇq
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -842,15 +841,15 @@ mod test {
|
||||||
async fn test_x(cx: &mut gpui::TestAppContext) {
|
async fn test_x(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["x"]);
|
let mut cx = cx.binding(["x"]);
|
||||||
cx.assert("|Test", "|est");
|
cx.assert("ˇTest", "ˇest");
|
||||||
cx.assert("Te|st", "Te|t");
|
cx.assert("Teˇst", "Teˇt");
|
||||||
cx.assert("Tes|t", "Te|s");
|
cx.assert("Tesˇt", "Teˇs");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Tes|t
|
Tesˇt
|
||||||
test"},
|
test"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Te|s
|
Teˇs
|
||||||
test"},
|
test"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -859,16 +858,16 @@ mod test {
|
||||||
async fn test_delete_left(cx: &mut gpui::TestAppContext) {
|
async fn test_delete_left(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["shift-x"]);
|
let mut cx = cx.binding(["shift-x"]);
|
||||||
cx.assert("Te|st", "T|st");
|
cx.assert("Teˇst", "Tˇst");
|
||||||
cx.assert("T|est", "|est");
|
cx.assert("Tˇest", "ˇest");
|
||||||
cx.assert("|Test", "|Test");
|
cx.assert("ˇTest", "ˇTest");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test
|
Test
|
||||||
|test"},
|
ˇtest"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test
|
Test
|
||||||
|test"},
|
ˇtest"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -878,78 +877,84 @@ mod test {
|
||||||
let mut cx = cx.binding(["o"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["o"]).mode_after(Mode::Insert);
|
||||||
|
|
||||||
cx.assert(
|
cx.assert(
|
||||||
"|",
|
"ˇ",
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
||||||
|"},
|
ˇ"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
"The |quick",
|
"The ˇquick",
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|"},
|
ˇ"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown |fox
|
brown ˇfox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
|
|
ˇ
|
||||||
jumps over"},
|
jumps over"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps |over"},
|
jumps ˇover"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over
|
jumps over
|
||||||
|"},
|
ˇ"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox
|
brown fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
||||||
|
|
ˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
fn test()
|
fn test() {
|
||||||
println!(|);"},
|
println!(ˇ);
|
||||||
|
}
|
||||||
|
"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
fn test()
|
fn test() {
|
||||||
println!();
|
println!();
|
||||||
|"},
|
ˇ
|
||||||
|
}
|
||||||
|
"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
fn test(|)
|
fn test(ˇ) {
|
||||||
println!();"},
|
println!();
|
||||||
|
}"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
fn test()
|
fn test() {
|
||||||
|
|
ˇ
|
||||||
println!();"},
|
println!();
|
||||||
|
}"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -959,25 +964,25 @@ mod test {
|
||||||
let mut cx = cx.binding(["shift-o"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["shift-o"]).mode_after(Mode::Insert);
|
||||||
|
|
||||||
cx.assert(
|
cx.assert(
|
||||||
"|",
|
"ˇ",
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
"},
|
"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
"The |quick",
|
"The ˇquick",
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
The quick"},
|
The quick"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown |fox
|
brown ˇfox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox
|
brown fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
);
|
);
|
||||||
|
@ -985,20 +990,20 @@ mod test {
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps |over"},
|
jumps ˇover"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
|
|
ˇ
|
||||||
jumps over"},
|
jumps over"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
|
@ -1006,31 +1011,33 @@ mod test {
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
|
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
fn test()
|
fn test()
|
||||||
println!(|);"},
|
println!(ˇ);"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
fn test()
|
fn test()
|
||||||
|
|
ˇ
|
||||||
println!();"},
|
println!();"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
fn test(|)
|
fn test(ˇ) {
|
||||||
println!();"},
|
println!();
|
||||||
|
}"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
fn test()
|
fn test() {
|
||||||
println!();"},
|
println!();
|
||||||
|
}"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1039,43 +1046,43 @@ mod test {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["d", "d"]);
|
let mut cx = cx.binding(["d", "d"]);
|
||||||
|
|
||||||
cx.assert("|", "|");
|
cx.assert("ˇ", "ˇ");
|
||||||
cx.assert("The |quick", "|");
|
cx.assert("The ˇquick", "ˇ");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown |fox
|
brown ˇfox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
jumps |over"},
|
jumps ˇover"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps |over"},
|
jumps ˇover"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown |fox"},
|
brown ˇfox"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
brown| fox
|
brownˇ fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|brown fox"},
|
ˇbrown fox"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1084,46 +1091,46 @@ mod test {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["c", "c"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["c", "c"]).mode_after(Mode::Insert);
|
||||||
|
|
||||||
cx.assert("|", "|");
|
cx.assert("ˇ", "ˇ");
|
||||||
cx.assert("The |quick", "|");
|
cx.assert("The ˇquick", "ˇ");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown |fox
|
brown ˇfox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
jumps over"},
|
jumps over"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps |over"},
|
jumps ˇover"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
|"},
|
ˇ"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
brown fox
|
brown fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1134,7 +1141,7 @@ mod test {
|
||||||
cx.set_state(
|
cx.set_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox ju|mps over
|
fox juˇmps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
Mode::Normal,
|
Mode::Normal,
|
||||||
);
|
);
|
||||||
|
@ -1142,21 +1149,21 @@ mod test {
|
||||||
cx.simulate_keystrokes(["d", "d"]);
|
cx.simulate_keystrokes(["d", "d"]);
|
||||||
cx.assert_editor_state(indoc! {"
|
cx.assert_editor_state(indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
the la|zy dog"});
|
the laˇzy dog"});
|
||||||
|
|
||||||
cx.simulate_keystroke("p");
|
cx.simulate_keystroke("p");
|
||||||
cx.assert_state(
|
cx.assert_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
the lazy dog
|
the lazy dog
|
||||||
|fox jumps over"},
|
ˇfox jumps over"},
|
||||||
Mode::Normal,
|
Mode::Normal,
|
||||||
);
|
);
|
||||||
|
|
||||||
cx.set_state(
|
cx.set_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox [jump}s over
|
fox «jumpˇ»s over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
Mode::Visual { line: false },
|
Mode::Visual { line: false },
|
||||||
);
|
);
|
||||||
|
@ -1164,7 +1171,7 @@ mod test {
|
||||||
cx.set_state(
|
cx.set_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps ove|r
|
fox jumps oveˇr
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
Mode::Normal,
|
Mode::Normal,
|
||||||
);
|
);
|
||||||
|
@ -1172,7 +1179,7 @@ mod test {
|
||||||
cx.assert_state(
|
cx.assert_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over|jumps
|
fox jumps overˇjumps
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
Mode::Normal,
|
Mode::Normal,
|
||||||
);
|
);
|
||||||
|
|
|
@ -84,16 +84,16 @@ mod test {
|
||||||
async fn test_change_h(cx: &mut gpui::TestAppContext) {
|
async fn test_change_h(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["c", "h"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["c", "h"]).mode_after(Mode::Insert);
|
||||||
cx.assert("Te|st", "T|st");
|
cx.assert("Teˇst", "Tˇst");
|
||||||
cx.assert("T|est", "|est");
|
cx.assert("Tˇest", "ˇest");
|
||||||
cx.assert("|Test", "|Test");
|
cx.assert("ˇTest", "ˇTest");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test
|
Test
|
||||||
|test"},
|
ˇtest"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test
|
Test
|
||||||
|test"},
|
ˇtest"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,111 +101,111 @@ mod test {
|
||||||
async fn test_change_l(cx: &mut gpui::TestAppContext) {
|
async fn test_change_l(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["c", "l"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["c", "l"]).mode_after(Mode::Insert);
|
||||||
cx.assert("Te|st", "Te|t");
|
cx.assert("Teˇst", "Teˇt");
|
||||||
cx.assert("Tes|t", "Tes|");
|
cx.assert("Tesˇt", "Tesˇ");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpui::test]
|
#[gpui::test]
|
||||||
async fn test_change_w(cx: &mut gpui::TestAppContext) {
|
async fn test_change_w(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["c", "w"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["c", "w"]).mode_after(Mode::Insert);
|
||||||
cx.assert("Te|st", "Te|");
|
cx.assert("Teˇst", "Teˇ");
|
||||||
cx.assert("T|est test", "T| test");
|
cx.assert("Tˇest test", "Tˇ test");
|
||||||
cx.assert("Test| test", "Test|test");
|
cx.assert("Testˇ test", "Testˇtest");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test te|st
|
Test teˇst
|
||||||
test"},
|
test"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test te|
|
Test teˇ
|
||||||
test"},
|
test"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test tes|t
|
Test tesˇt
|
||||||
test"},
|
test"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test tes|
|
Test tesˇ
|
||||||
test"},
|
test"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test test
|
Test test
|
||||||
|
|
ˇ
|
||||||
test"},
|
test"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test test
|
Test test
|
||||||
|
|
ˇ
|
||||||
test"},
|
test"},
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut cx = cx.binding(["c", "shift-w"]);
|
let mut cx = cx.binding(["c", "shift-w"]);
|
||||||
cx.assert("Test te|st-test test", "Test te| test");
|
cx.assert("Test teˇst-test test", "Test teˇ test");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpui::test]
|
#[gpui::test]
|
||||||
async fn test_change_e(cx: &mut gpui::TestAppContext) {
|
async fn test_change_e(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["c", "e"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["c", "e"]).mode_after(Mode::Insert);
|
||||||
cx.assert("Te|st Test", "Te| Test");
|
cx.assert("Teˇst Test", "Teˇ Test");
|
||||||
cx.assert("T|est test", "T| test");
|
cx.assert("Tˇest test", "Tˇ test");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test te|st
|
Test teˇst
|
||||||
test"},
|
test"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test te|
|
Test teˇ
|
||||||
test"},
|
test"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test tes|t
|
Test tesˇt
|
||||||
test"},
|
test"},
|
||||||
"Test tes|",
|
"Test tesˇ",
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test test
|
Test test
|
||||||
|
|
ˇ
|
||||||
test"},
|
test"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test test
|
Test test
|
||||||
|
|
ˇ
|
||||||
test"},
|
test"},
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut cx = cx.binding(["c", "shift-e"]);
|
let mut cx = cx.binding(["c", "shift-e"]);
|
||||||
cx.assert("Test te|st-test test", "Test te| test");
|
cx.assert("Test teˇst-test test", "Test teˇ test");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpui::test]
|
#[gpui::test]
|
||||||
async fn test_change_b(cx: &mut gpui::TestAppContext) {
|
async fn test_change_b(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["c", "b"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["c", "b"]).mode_after(Mode::Insert);
|
||||||
cx.assert("Te|st Test", "|st Test");
|
cx.assert("Teˇst Test", "ˇst Test");
|
||||||
cx.assert("Test |test", "|test");
|
cx.assert("Test ˇtest", "ˇtest");
|
||||||
cx.assert("Test1 test2 |test3", "Test1 |test3");
|
cx.assert("Test1 test2 ˇtest3", "Test1 ˇtest3");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test test
|
Test test
|
||||||
|test"},
|
ˇtest"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test |
|
Test ˇ
|
||||||
test"},
|
test"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test test
|
Test test
|
||||||
|
|
ˇ
|
||||||
test"},
|
test"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test |
|
Test ˇ
|
||||||
|
|
||||||
test"},
|
test"},
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut cx = cx.binding(["c", "shift-b"]);
|
let mut cx = cx.binding(["c", "shift-b"]);
|
||||||
cx.assert("Test test-test |test", "Test |test");
|
cx.assert("Test test-test ˇtest", "Test ˇtest");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpui::test]
|
#[gpui::test]
|
||||||
|
@ -214,20 +214,20 @@ mod test {
|
||||||
let mut cx = cx.binding(["c", "$"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["c", "$"]).mode_after(Mode::Insert);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|
|
The qˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -238,20 +238,20 @@ mod test {
|
||||||
let mut cx = cx.binding(["c", "0"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["c", "0"]).mode_after(Mode::Insert);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|uick
|
ˇuick
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -263,38 +263,38 @@ mod test {
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown |fox
|
brown ˇfox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
jumps over"},
|
jumps over"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps |over"},
|
jumps ˇover"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|"},
|
ˇ"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
brown fox
|
brown fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
brown fox
|
brown fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
brown fox
|
brown fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
);
|
);
|
||||||
|
@ -307,40 +307,40 @@ mod test {
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown |fox
|
brown ˇfox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|"},
|
ˇ"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps |over"},
|
jumps ˇover"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
|"},
|
ˇ"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
jumps over"},
|
jumps over"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
|"},
|
ˇ"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
|"},
|
ˇ"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,46 +351,46 @@ mod test {
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown| fox
|
brownˇ fox
|
||||||
jumps over
|
jumps over
|
||||||
the lazy"},
|
the lazy"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|"},
|
ˇ"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown| fox
|
brownˇ fox
|
||||||
jumps over
|
jumps over
|
||||||
the lazy"},
|
the lazy"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|"},
|
ˇ"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over
|
jumps over
|
||||||
the l|azy"},
|
the lˇazy"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over
|
jumps over
|
||||||
|"},
|
ˇ"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over
|
jumps over
|
||||||
|"},
|
ˇ"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over
|
jumps over
|
||||||
|"},
|
ˇ"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -401,11 +401,11 @@ mod test {
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown| fox
|
brownˇ fox
|
||||||
jumps over
|
jumps over
|
||||||
the lazy"},
|
the lazy"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
jumps over
|
jumps over
|
||||||
the lazy"},
|
the lazy"},
|
||||||
);
|
);
|
||||||
|
@ -414,29 +414,29 @@ mod test {
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over
|
jumps over
|
||||||
the l|azy"},
|
the lˇazy"},
|
||||||
"|",
|
"ˇ",
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over
|
jumps over
|
||||||
the lazy"},
|
the lazy"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
brown fox
|
brown fox
|
||||||
jumps over
|
jumps over
|
||||||
the lazy"},
|
the lazy"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
brown fox
|
brown fox
|
||||||
jumps over
|
jumps over
|
||||||
the lazy"},
|
the lazy"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
brown fox
|
brown fox
|
||||||
jumps over
|
jumps over
|
||||||
the lazy"},
|
the lazy"},
|
||||||
|
|
|
@ -46,16 +46,16 @@ mod test {
|
||||||
async fn test_delete_h(cx: &mut gpui::TestAppContext) {
|
async fn test_delete_h(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["d", "h"]);
|
let mut cx = cx.binding(["d", "h"]);
|
||||||
cx.assert("Te|st", "T|st");
|
cx.assert("Teˇst", "Tˇst");
|
||||||
cx.assert("T|est", "|est");
|
cx.assert("Tˇest", "ˇest");
|
||||||
cx.assert("|Test", "|Test");
|
cx.assert("ˇTest", "ˇTest");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test
|
Test
|
||||||
|test"},
|
ˇtest"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test
|
Test
|
||||||
|test"},
|
ˇtest"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,15 +63,15 @@ mod test {
|
||||||
async fn test_delete_l(cx: &mut gpui::TestAppContext) {
|
async fn test_delete_l(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["d", "l"]);
|
let mut cx = cx.binding(["d", "l"]);
|
||||||
cx.assert("|Test", "|est");
|
cx.assert("ˇTest", "ˇest");
|
||||||
cx.assert("Te|st", "Te|t");
|
cx.assert("Teˇst", "Teˇt");
|
||||||
cx.assert("Tes|t", "Te|s");
|
cx.assert("Tesˇt", "Teˇs");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Tes|t
|
Tesˇt
|
||||||
test"},
|
test"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Te|s
|
Teˇs
|
||||||
test"},
|
test"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -80,104 +80,104 @@ mod test {
|
||||||
async fn test_delete_w(cx: &mut gpui::TestAppContext) {
|
async fn test_delete_w(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["d", "w"]);
|
let mut cx = cx.binding(["d", "w"]);
|
||||||
cx.assert("Te|st", "T|e");
|
cx.assert("Teˇst", "Tˇe");
|
||||||
cx.assert("T|est test", "T|test");
|
cx.assert("Tˇest test", "Tˇtest");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test te|st
|
Test teˇst
|
||||||
test"},
|
test"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test t|e
|
Test tˇe
|
||||||
test"},
|
test"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test tes|t
|
Test tesˇt
|
||||||
test"},
|
test"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test te|s
|
Test teˇs
|
||||||
test"},
|
test"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test test
|
Test test
|
||||||
|
|
ˇ
|
||||||
test"},
|
test"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test test
|
Test test
|
||||||
|
|
ˇ
|
||||||
test"},
|
test"},
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut cx = cx.binding(["d", "shift-w"]);
|
let mut cx = cx.binding(["d", "shift-w"]);
|
||||||
cx.assert("Test te|st-test test", "Test te|test");
|
cx.assert("Test teˇst-test test", "Test teˇtest");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpui::test]
|
#[gpui::test]
|
||||||
async fn test_delete_e(cx: &mut gpui::TestAppContext) {
|
async fn test_delete_e(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["d", "e"]);
|
let mut cx = cx.binding(["d", "e"]);
|
||||||
cx.assert("Te|st Test", "Te| Test");
|
cx.assert("Teˇst Test", "Teˇ Test");
|
||||||
cx.assert("T|est test", "T| test");
|
cx.assert("Tˇest test", "Tˇ test");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test te|st
|
Test teˇst
|
||||||
test"},
|
test"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test t|e
|
Test tˇe
|
||||||
test"},
|
test"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test tes|t
|
Test tesˇt
|
||||||
test"},
|
test"},
|
||||||
"Test te|s",
|
"Test teˇs",
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test test
|
Test test
|
||||||
|
|
ˇ
|
||||||
test"},
|
test"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test test
|
Test test
|
||||||
|
|
ˇ
|
||||||
test"},
|
test"},
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut cx = cx.binding(["d", "shift-e"]);
|
let mut cx = cx.binding(["d", "shift-e"]);
|
||||||
cx.assert("Test te|st-test test", "Test te| test");
|
cx.assert("Test teˇst-test test", "Test teˇ test");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpui::test]
|
#[gpui::test]
|
||||||
async fn test_delete_b(cx: &mut gpui::TestAppContext) {
|
async fn test_delete_b(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["d", "b"]);
|
let mut cx = cx.binding(["d", "b"]);
|
||||||
cx.assert("Te|st Test", "|st Test");
|
cx.assert("Teˇst Test", "ˇst Test");
|
||||||
cx.assert("Test |test", "|test");
|
cx.assert("Test ˇtest", "ˇtest");
|
||||||
cx.assert("Test1 test2 |test3", "Test1 |test3");
|
cx.assert("Test1 test2 ˇtest3", "Test1 ˇtest3");
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test test
|
Test test
|
||||||
|test"},
|
ˇtest"},
|
||||||
// Trailing whitespace after cursor
|
// Trailing whitespace after cursor
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test|
|
Testˇ
|
||||||
test"},
|
test"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test test
|
Test test
|
||||||
|
|
ˇ
|
||||||
test"},
|
test"},
|
||||||
// Trailing whitespace after cursor
|
// Trailing whitespace after cursor
|
||||||
indoc! {"
|
indoc! {"
|
||||||
Test|
|
Testˇ
|
||||||
|
|
||||||
test"},
|
test"},
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut cx = cx.binding(["d", "shift-b"]);
|
let mut cx = cx.binding(["d", "shift-b"]);
|
||||||
cx.assert("Test test-test |test", "Test |test");
|
cx.assert("Test test-test ˇtest", "Test ˇtest");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpui::test]
|
#[gpui::test]
|
||||||
|
@ -186,20 +186,20 @@ mod test {
|
||||||
let mut cx = cx.binding(["d", "$"]);
|
let mut cx = cx.binding(["d", "$"]);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |q
|
The ˇq
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -210,20 +210,20 @@ mod test {
|
||||||
let mut cx = cx.binding(["d", "0"]);
|
let mut cx = cx.binding(["d", "0"]);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|uick
|
ˇuick
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|
|
ˇ
|
||||||
brown fox"},
|
brown fox"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -235,31 +235,31 @@ mod test {
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown |fox
|
brown ˇfox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
"jumps |over",
|
"jumps ˇover",
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps |over"},
|
jumps ˇover"},
|
||||||
"The qu|ick",
|
"The quˇick",
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
brown| fox
|
brownˇ fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|brown fox
|
ˇbrown fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
"|jumps over",
|
"ˇjumps over",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,34 +270,34 @@ mod test {
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown |fox
|
brown ˇfox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
"The qu|ick",
|
"The quˇick",
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps |over"},
|
jumps ˇover"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown |fox"},
|
brown ˇfox"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over"},
|
jumps over"},
|
||||||
"jumps| over",
|
"jumpsˇ over",
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
|"},
|
ˇ"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
|brown fox"},
|
ˇbrown fox"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,40 +308,40 @@ mod test {
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown| fox
|
brownˇ fox
|
||||||
jumps over
|
jumps over
|
||||||
the lazy"},
|
the lazy"},
|
||||||
"The q|uick",
|
"The qˇuick",
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown| fox
|
brownˇ fox
|
||||||
jumps over
|
jumps over
|
||||||
the lazy"},
|
the lazy"},
|
||||||
"The q|uick",
|
"The qˇuick",
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over
|
jumps over
|
||||||
the l|azy"},
|
the lˇazy"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps| over"},
|
jumpsˇ over"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over
|
jumps over
|
||||||
|"},
|
ˇ"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
|jumps over"},
|
ˇjumps over"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,11 +352,11 @@ mod test {
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick
|
The quick
|
||||||
brown| fox
|
brownˇ fox
|
||||||
jumps over
|
jumps over
|
||||||
the lazy"},
|
the lazy"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
jumps| over
|
jumpsˇ over
|
||||||
the lazy"},
|
the lazy"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
|
@ -364,28 +364,28 @@ mod test {
|
||||||
The quick
|
The quick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over
|
jumps over
|
||||||
the l|azy"},
|
the lˇazy"},
|
||||||
"|",
|
"ˇ",
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The q|uick
|
The qˇuick
|
||||||
brown fox
|
brown fox
|
||||||
jumps over
|
jumps over
|
||||||
the lazy"},
|
the lazy"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
brown| fox
|
brownˇ fox
|
||||||
jumps over
|
jumps over
|
||||||
the lazy"},
|
the lazy"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
brown fox
|
brown fox
|
||||||
jumps over
|
jumps over
|
||||||
the lazy"},
|
the lazy"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|brown fox
|
ˇbrown fox
|
||||||
jumps over
|
jumps over
|
||||||
the lazy"},
|
the lazy"},
|
||||||
);
|
);
|
||||||
|
@ -397,7 +397,7 @@ mod test {
|
||||||
cx.set_state(
|
cx.set_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox ju|mps over
|
fox juˇmps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
Mode::Normal,
|
Mode::Normal,
|
||||||
);
|
);
|
||||||
|
@ -407,7 +407,7 @@ mod test {
|
||||||
assert_eq!(cx.active_operator(), None);
|
assert_eq!(cx.active_operator(), None);
|
||||||
assert_eq!(cx.mode(), Mode::Normal);
|
assert_eq!(cx.mode(), Mode::Normal);
|
||||||
cx.assert_editor_state(indoc! {"
|
cx.assert_editor_state(indoc! {"
|
||||||
The qu|ick brown
|
The quˇick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"});
|
the lazy dog"});
|
||||||
}
|
}
|
||||||
|
@ -418,7 +418,7 @@ mod test {
|
||||||
cx.set_state(
|
cx.set_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox ju|mps over
|
fox juˇmps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
Mode::Normal,
|
Mode::Normal,
|
||||||
);
|
);
|
||||||
|
|
|
@ -216,7 +216,7 @@ mod test {
|
||||||
async fn test_initially_disabled(cx: &mut gpui::TestAppContext) {
|
async fn test_initially_disabled(cx: &mut gpui::TestAppContext) {
|
||||||
let mut cx = VimTestContext::new(cx, false).await;
|
let mut cx = VimTestContext::new(cx, false).await;
|
||||||
cx.simulate_keystrokes(["h", "j", "k", "l"]);
|
cx.simulate_keystrokes(["h", "j", "k", "l"]);
|
||||||
cx.assert_editor_state("hjkl|");
|
cx.assert_editor_state("hjklˇ");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[gpui::test]
|
#[gpui::test]
|
||||||
|
@ -229,24 +229,24 @@ mod test {
|
||||||
// Editor acts as though vim is disabled
|
// Editor acts as though vim is disabled
|
||||||
cx.disable_vim();
|
cx.disable_vim();
|
||||||
cx.simulate_keystrokes(["h", "j", "k", "l"]);
|
cx.simulate_keystrokes(["h", "j", "k", "l"]);
|
||||||
cx.assert_editor_state("hjkl|");
|
cx.assert_editor_state("hjklˇ");
|
||||||
|
|
||||||
// Selections aren't changed if editor is blurred but vim-mode is still disabled.
|
// Selections aren't changed if editor is blurred but vim-mode is still disabled.
|
||||||
cx.set_state("[hjkl}", Mode::Normal);
|
cx.set_state("«hjklˇ»", Mode::Normal);
|
||||||
cx.assert_editor_state("[hjkl}");
|
cx.assert_editor_state("«hjklˇ»");
|
||||||
cx.update_editor(|_, cx| cx.blur());
|
cx.update_editor(|_, cx| cx.blur());
|
||||||
cx.assert_editor_state("[hjkl}");
|
cx.assert_editor_state("«hjklˇ»");
|
||||||
cx.update_editor(|_, cx| cx.focus_self());
|
cx.update_editor(|_, cx| cx.focus_self());
|
||||||
cx.assert_editor_state("[hjkl}");
|
cx.assert_editor_state("«hjklˇ»");
|
||||||
|
|
||||||
// Enabling dynamically sets vim mode again and restores normal mode
|
// Enabling dynamically sets vim mode again and restores normal mode
|
||||||
cx.enable_vim();
|
cx.enable_vim();
|
||||||
assert_eq!(cx.mode(), Mode::Normal);
|
assert_eq!(cx.mode(), Mode::Normal);
|
||||||
cx.simulate_keystrokes(["h", "h", "h", "l"]);
|
cx.simulate_keystrokes(["h", "h", "h", "l"]);
|
||||||
assert_eq!(cx.buffer_text(), "hjkl".to_owned());
|
assert_eq!(cx.buffer_text(), "hjkl".to_owned());
|
||||||
cx.assert_editor_state("h|jkl");
|
cx.assert_editor_state("hˇjkl");
|
||||||
cx.simulate_keystrokes(["i", "T", "e", "s", "t"]);
|
cx.simulate_keystrokes(["i", "T", "e", "s", "t"]);
|
||||||
cx.assert_editor_state("hTest|jkl");
|
cx.assert_editor_state("hTestˇjkl");
|
||||||
|
|
||||||
// Disabling and enabling resets to normal mode
|
// Disabling and enabling resets to normal mode
|
||||||
assert_eq!(cx.mode(), Mode::Insert);
|
assert_eq!(cx.mode(), Mode::Insert);
|
||||||
|
@ -262,7 +262,7 @@ mod test {
|
||||||
cx.set_state(
|
cx.set_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox ju|mps over
|
fox juˇmps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
Mode::Normal,
|
Mode::Normal,
|
||||||
);
|
);
|
||||||
|
|
|
@ -284,44 +284,44 @@ mod test {
|
||||||
.mode_after(Mode::Visual { line: false });
|
.mode_after(Mode::Visual { line: false });
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick brown
|
The ˇquick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The [quick brown
|
The «quick brown
|
||||||
fox jumps }over
|
fox jumps ˇ»over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the |lazy dog"},
|
the ˇlazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the [lazy }dog"},
|
the «lazy ˇ»dog"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps |over
|
fox jumps ˇover
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps [over
|
fox jumps «over
|
||||||
}the lazy dog"},
|
ˇ»the lazy dog"},
|
||||||
);
|
);
|
||||||
let mut cx = cx
|
let mut cx = cx
|
||||||
.binding(["v", "b", "k"])
|
.binding(["v", "b", "k"])
|
||||||
.mode_after(Mode::Visual { line: false });
|
.mode_after(Mode::Visual { line: false });
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick brown
|
The ˇquick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
{The q]uick brown
|
«ˇThe q»uick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
|
@ -329,20 +329,20 @@ mod test {
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the |lazy dog"},
|
the ˇlazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
{fox jumps over
|
«ˇfox jumps over
|
||||||
the l]azy dog"},
|
the l»azy dog"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps |over
|
fox jumps ˇover
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The {quick brown
|
The «ˇquick brown
|
||||||
fox jumps o]ver
|
fox jumps o»ver
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -351,51 +351,51 @@ mod test {
|
||||||
async fn test_visual_delete(cx: &mut gpui::TestAppContext) {
|
async fn test_visual_delete(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["v", "w", "x"]);
|
let mut cx = cx.binding(["v", "w", "x"]);
|
||||||
cx.assert("The quick |brown", "The quick| ");
|
cx.assert("The quick ˇbrown", "The quickˇ ");
|
||||||
let mut cx = cx.binding(["v", "w", "j", "x"]);
|
let mut cx = cx.binding(["v", "w", "j", "x"]);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick brown
|
The ˇquick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |ver
|
The ˇver
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
// Test pasting code copied on delete
|
// Test pasting code copied on delete
|
||||||
cx.simulate_keystrokes(["j", "p"]);
|
cx.simulate_keystrokes(["j", "p"]);
|
||||||
cx.assert_editor_state(indoc! {"
|
cx.assert_editor_state(indoc! {"
|
||||||
The ver
|
The ver
|
||||||
the l|quick brown
|
the lˇquick brown
|
||||||
fox jumps oazy dog"});
|
fox jumps oazy dog"});
|
||||||
|
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the |lazy dog"},
|
the ˇlazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the |og"},
|
the ˇog"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps |over
|
fox jumps ˇover
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps |he lazy dog"},
|
fox jumps ˇhe lazy dog"},
|
||||||
);
|
);
|
||||||
let mut cx = cx.binding(["v", "b", "k", "x"]);
|
let mut cx = cx.binding(["v", "b", "k", "x"]);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick brown
|
The ˇquick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|uick brown
|
ˇuick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
|
@ -403,18 +403,18 @@ mod test {
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the |lazy dog"},
|
the ˇlazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
|azy dog"},
|
ˇazy dog"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps |over
|
fox jumps ˇover
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |ver
|
The ˇver
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -425,68 +425,68 @@ mod test {
|
||||||
let mut cx = cx.binding(["shift-v", "x"]);
|
let mut cx = cx.binding(["shift-v", "x"]);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The qu|ick brown
|
The quˇick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
fox ju|mps over
|
fox juˇmps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
// Test pasting code copied on delete
|
// Test pasting code copied on delete
|
||||||
cx.simulate_keystroke("p");
|
cx.simulate_keystroke("p");
|
||||||
cx.assert_editor_state(indoc! {"
|
cx.assert_editor_state(indoc! {"
|
||||||
fox jumps over
|
fox jumps over
|
||||||
|The quick brown
|
ˇThe quick brown
|
||||||
the lazy dog"});
|
the lazy dog"});
|
||||||
|
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox ju|mps over
|
fox juˇmps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
the la|zy dog"},
|
the laˇzy dog"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the la|zy dog"},
|
the laˇzy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox ju|mps over"},
|
fox juˇmps over"},
|
||||||
);
|
);
|
||||||
let mut cx = cx.binding(["shift-v", "j", "x"]);
|
let mut cx = cx.binding(["shift-v", "j", "x"]);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The qu|ick brown
|
The quˇick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
"the la|zy dog",
|
"the laˇzy dog",
|
||||||
);
|
);
|
||||||
// Test pasting code copied on delete
|
// Test pasting code copied on delete
|
||||||
cx.simulate_keystroke("p");
|
cx.simulate_keystroke("p");
|
||||||
cx.assert_editor_state(indoc! {"
|
cx.assert_editor_state(indoc! {"
|
||||||
the lazy dog
|
the lazy dog
|
||||||
|The quick brown
|
ˇThe quick brown
|
||||||
fox jumps over"});
|
fox jumps over"});
|
||||||
|
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox ju|mps over
|
fox juˇmps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
"The qu|ick brown",
|
"The quˇick brown",
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the la|zy dog"},
|
the laˇzy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox ju|mps over"},
|
fox juˇmps over"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -494,44 +494,44 @@ mod test {
|
||||||
async fn test_visual_change(cx: &mut gpui::TestAppContext) {
|
async fn test_visual_change(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["v", "w", "c"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["v", "w", "c"]).mode_after(Mode::Insert);
|
||||||
cx.assert("The quick |brown", "The quick |");
|
cx.assert("The quick ˇbrown", "The quick ˇ");
|
||||||
let mut cx = cx.binding(["v", "w", "j", "c"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["v", "w", "j", "c"]).mode_after(Mode::Insert);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick brown
|
The ˇquick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |ver
|
The ˇver
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the |lazy dog"},
|
the ˇlazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the |og"},
|
the ˇog"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps |over
|
fox jumps ˇover
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps |he lazy dog"},
|
fox jumps ˇhe lazy dog"},
|
||||||
);
|
);
|
||||||
let mut cx = cx.binding(["v", "b", "k", "c"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["v", "b", "k", "c"]).mode_after(Mode::Insert);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick brown
|
The ˇquick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|uick brown
|
ˇuick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
|
@ -539,18 +539,18 @@ mod test {
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the |lazy dog"},
|
the ˇlazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
|azy dog"},
|
ˇazy dog"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps |over
|
fox jumps ˇover
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |ver
|
The ˇver
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -561,11 +561,11 @@ mod test {
|
||||||
let mut cx = cx.binding(["shift-v", "c"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["shift-v", "c"]).mode_after(Mode::Insert);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The qu|ick brown
|
The quˇick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
|
@ -574,37 +574,37 @@ mod test {
|
||||||
cx.assert_editor_state(indoc! {"
|
cx.assert_editor_state(indoc! {"
|
||||||
|
|
||||||
fox jumps over
|
fox jumps over
|
||||||
|The quick brown
|
ˇThe quick brown
|
||||||
the lazy dog"});
|
the lazy dog"});
|
||||||
|
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox ju|mps over
|
fox juˇmps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
|
|
ˇ
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the la|zy dog"},
|
the laˇzy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
|"},
|
ˇ"},
|
||||||
);
|
);
|
||||||
let mut cx = cx.binding(["shift-v", "j", "c"]).mode_after(Mode::Insert);
|
let mut cx = cx.binding(["shift-v", "j", "c"]).mode_after(Mode::Insert);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The qu|ick brown
|
The quˇick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|
|
ˇ
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
// Test pasting code copied on delete
|
// Test pasting code copied on delete
|
||||||
|
@ -612,26 +612,26 @@ mod test {
|
||||||
cx.assert_editor_state(indoc! {"
|
cx.assert_editor_state(indoc! {"
|
||||||
|
|
||||||
the lazy dog
|
the lazy dog
|
||||||
|The quick brown
|
ˇThe quick brown
|
||||||
fox jumps over"});
|
fox jumps over"});
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox ju|mps over
|
fox juˇmps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
|"},
|
ˇ"},
|
||||||
);
|
);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the la|zy dog"},
|
the laˇzy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
|"},
|
ˇ"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -639,16 +639,16 @@ mod test {
|
||||||
async fn test_visual_yank(cx: &mut gpui::TestAppContext) {
|
async fn test_visual_yank(cx: &mut gpui::TestAppContext) {
|
||||||
let cx = VimTestContext::new(cx, true).await;
|
let cx = VimTestContext::new(cx, true).await;
|
||||||
let mut cx = cx.binding(["v", "w", "y"]);
|
let mut cx = cx.binding(["v", "w", "y"]);
|
||||||
cx.assert("The quick |brown", "The quick |brown");
|
cx.assert("The quick ˇbrown", "The quick ˇbrown");
|
||||||
cx.assert_clipboard_content(Some("brown"));
|
cx.assert_clipboard_content(Some("brown"));
|
||||||
let mut cx = cx.binding(["v", "w", "j", "y"]);
|
let mut cx = cx.binding(["v", "w", "j", "y"]);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick brown
|
The ˇquick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick brown
|
The ˇquick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
|
@ -659,21 +659,21 @@ mod test {
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the |lazy dog"},
|
the ˇlazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the |lazy dog"},
|
the ˇlazy dog"},
|
||||||
);
|
);
|
||||||
cx.assert_clipboard_content(Some("lazy d"));
|
cx.assert_clipboard_content(Some("lazy d"));
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps |over
|
fox jumps ˇover
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps |over
|
fox jumps ˇover
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
cx.assert_clipboard_content(Some(indoc! {"
|
cx.assert_clipboard_content(Some(indoc! {"
|
||||||
|
@ -682,11 +682,11 @@ mod test {
|
||||||
let mut cx = cx.binding(["v", "b", "k", "y"]);
|
let mut cx = cx.binding(["v", "b", "k", "y"]);
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick brown
|
The ˇquick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
|The quick brown
|
ˇThe quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
|
@ -695,10 +695,10 @@ mod test {
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the |lazy dog"},
|
the ˇlazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
|fox jumps over
|
ˇfox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
cx.assert_clipboard_content(Some(indoc! {"
|
cx.assert_clipboard_content(Some(indoc! {"
|
||||||
|
@ -707,10 +707,10 @@ mod test {
|
||||||
cx.assert(
|
cx.assert(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps |over
|
fox jumps ˇover
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The |quick brown
|
The ˇquick brown
|
||||||
fox jumps over
|
fox jumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
);
|
);
|
||||||
|
@ -725,7 +725,7 @@ mod test {
|
||||||
cx.set_state(
|
cx.set_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox [jump}s over
|
fox «jumpˇ»s over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
Mode::Visual { line: false },
|
Mode::Visual { line: false },
|
||||||
);
|
);
|
||||||
|
@ -733,7 +733,7 @@ mod test {
|
||||||
cx.set_state(
|
cx.set_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jump|s over
|
fox jumpˇs over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
Mode::Normal,
|
Mode::Normal,
|
||||||
);
|
);
|
||||||
|
@ -741,7 +741,7 @@ mod test {
|
||||||
cx.assert_state(
|
cx.assert_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox jumps|jumps over
|
fox jumpsˇjumps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
Mode::Normal,
|
Mode::Normal,
|
||||||
);
|
);
|
||||||
|
@ -749,7 +749,7 @@ mod test {
|
||||||
cx.set_state(
|
cx.set_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
fox ju|mps over
|
fox juˇmps over
|
||||||
the lazy dog"},
|
the lazy dog"},
|
||||||
Mode::Visual { line: true },
|
Mode::Visual { line: true },
|
||||||
);
|
);
|
||||||
|
@ -757,13 +757,13 @@ mod test {
|
||||||
cx.assert_state(
|
cx.assert_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
the la|zy dog"},
|
the laˇzy dog"},
|
||||||
Mode::Normal,
|
Mode::Normal,
|
||||||
);
|
);
|
||||||
cx.set_state(
|
cx.set_state(
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
the [laz}y dog"},
|
the «lazˇ»y dog"},
|
||||||
Mode::Visual { line: false },
|
Mode::Visual { line: false },
|
||||||
);
|
);
|
||||||
cx.simulate_keystroke("p");
|
cx.simulate_keystroke("p");
|
||||||
|
@ -771,7 +771,7 @@ mod test {
|
||||||
indoc! {"
|
indoc! {"
|
||||||
The quick brown
|
The quick brown
|
||||||
the
|
the
|
||||||
|fox jumps over
|
ˇfox jumps over
|
||||||
dog"},
|
dog"},
|
||||||
Mode::Normal,
|
Mode::Normal,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue