Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix slowness in Terminal when vi-mode is enabled (#31824)

Aleksei Gusevcc536655a1ef
diff --git a/crates/terminal_view/src/terminal_view.rs b/crates/terminal_view/src/terminal_view.rs
index af1466a1a25..c393fd54ad1 100644
--- a/crates/terminal_view/src/terminal_view.rs
+++ b/crates/terminal_view/src/terminal_view.rs
@@ -651,7 +651,12 @@ impl TerminalView {
if let Some(keystroke) = Keystroke::parse(&text.0).log_err() {
self.clear_bell(cx);
self.terminal.update(cx, |term, cx| {
- term.try_keystroke(&keystroke, TerminalSettings::get_global(cx).option_as_meta);
+ let processed =
+ term.try_keystroke(&keystroke, TerminalSettings::get_global(cx).option_as_meta);
+ if processed && term.vi_mode_enabled() {
+ cx.notify();
+ }
+ processed
});
}
}