fix final failing tests

This commit is contained in:
Kay Simmons 2022-12-08 14:39:48 -08:00
parent f6f41510d2
commit 2cf48c03f9
6 changed files with 55 additions and 48 deletions

View file

@ -200,7 +200,6 @@ mod test {
Test test
ˇtest"})
.await;
println!("Marker");
cx.assert(indoc! {"
Test test
ˇ

View file

@ -51,8 +51,9 @@ impl<'a> VimTestContext<'a> {
)
});
// Setup search toolbars
// Setup search toolbars and keypress hook
workspace.update(cx, |workspace, cx| {
observe_keypresses(window_id, cx);
workspace.active_pane().update(cx, |pane, cx| {
pane.toolbar().update(cx, |toolbar, cx| {
let buffer_search_bar = cx.add_view(BufferSearchBar::new);

View file

@ -81,20 +81,20 @@ pub fn init(cx: &mut MutableAppContext) {
.detach();
}
// Any keystrokes not mapped to vim should clar the active operator
// Any keystrokes not mapped to vim should clear the active operator
pub fn observe_keypresses(window_id: usize, cx: &mut MutableAppContext) {
cx.observe_keystrokes(window_id, |_keystroke, _result, handled_by, cx| {
dbg!(_keystroke);
dbg!(_result);
if let Some(handled_by) = handled_by {
dbg!(handled_by.name());
if handled_by.namespace() == "vim" {
println!("Vim action. Don't clear");
return true;
}
}
Vim::update(cx, |vim, cx| {
if vim.active_operator().is_some() {
println!("Clearing operator");
vim.clear_operator(cx);
}
});