When searching in visual mode switch to normal mode
This matches Neovim behaviour by setting the mode to `Normal` when using search while in visual mode. Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
parent
0858db9ebb
commit
87be105af7
3 changed files with 39 additions and 4 deletions
|
@ -277,6 +277,24 @@ impl NeovimBackedTestContext {
|
|||
self.neovim.mode().await.unwrap()
|
||||
}
|
||||
|
||||
pub async fn assert_shared_mode(&mut self, mode: Mode) {
|
||||
let neovim = self.neovim_mode().await;
|
||||
let editor = self.cx.mode();
|
||||
|
||||
if neovim != mode || editor != mode {
|
||||
panic!(
|
||||
indoc! {"Test failed (zed does not match nvim behaviour)
|
||||
# desired mode:
|
||||
{:?}
|
||||
# neovim mode:
|
||||
{:?}
|
||||
# zed mode:
|
||||
{:?}"},
|
||||
mode, neovim, editor,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn assert_state_matches(&mut self) {
|
||||
self.is_dirty = false;
|
||||
let neovim = self.neovim_state().await;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue