vim: Enable % to jump between tags (#20536)

Closes #12986

Release Notes:

- Enable `%` to jump between pairs of tags

---------

Co-authored-by: Harrison <hrouillard@sfi.com.au>
This commit is contained in:
hrou0003 2024-11-15 06:41:53 +11:00 committed by GitHub
parent 189a034e71
commit f0882f44a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 159 additions and 10 deletions

View file

@ -162,6 +162,30 @@ impl NeovimBackedTestContext {
}
}
pub async fn new_html(cx: &mut gpui::TestAppContext) -> NeovimBackedTestContext {
#[cfg(feature = "neovim")]
cx.executor().allow_parking();
// rust stores the name of the test on the current thread.
// We use this to automatically name a file that will store
// the neovim connection's requests/responses so that we can
// run without neovim on CI.
let thread = thread::current();
let test_name = thread
.name()
.expect("thread is not named")
.split(':')
.last()
.unwrap()
.to_string();
Self {
cx: VimTestContext::new_html(cx).await,
neovim: NeovimConnection::new(test_name).await,
last_set_state: None,
recent_keystrokes: Default::default(),
}
}
pub async fn set_shared_state(&mut self, marked_text: &str) {
let mode = if marked_text.contains('»') {
Mode::Visual