fix final failing tests
This commit is contained in:
parent
f6f41510d2
commit
2cf48c03f9
6 changed files with 55 additions and 48 deletions
|
@ -200,7 +200,6 @@ mod test {
|
|||
Test test
|
||||
ˇtest"})
|
||||
.await;
|
||||
println!("Marker");
|
||||
cx.assert(indoc! {"
|
||||
Test test
|
||||
ˇ
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue