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.

vim: Fix inline completions showing up in normal mode (#17727)

Thorsten Ball3a6a29f1173e
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index f750abd95c7..e50bf67ab01 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -4975,9 +4975,10 @@ impl Editor {
let cursor = self.selections.newest_anchor().head();
let (buffer, cursor_buffer_position) =
self.buffer.read(cx).text_anchor_for_position(cursor, cx)?;
+
if !user_requested
- && self.enable_inline_completions
- && !self.should_show_inline_completions(&buffer, cursor_buffer_position, cx)
+ && (!self.enable_inline_completions
+ || !self.should_show_inline_completions(&buffer, cursor_buffer_position, cx))
{
self.discard_inline_completion(false, cx);
return None;