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 assistant hints showing up when selecting \n in Vim mode (#20899)

Thorsten Ball743165fa6c5c
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index d303ecf0f39..7f31cdedd37 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -11875,7 +11875,15 @@ impl Editor {
style: &EditorStyle,
cx: &mut WindowContext,
) -> Option<AnyElement> {
- if !self.newest_selection_head_on_empty_line(cx) || self.has_active_inline_completion(cx) {
+ let selection = self.selections.newest::<Point>(cx);
+ if !selection.is_empty() {
+ return None;
+ };
+
+ let snapshot = self.buffer.read(cx).snapshot(cx);
+ let buffer_row = MultiBufferRow(selection.head().row);
+
+ if snapshot.line_len(buffer_row) != 0 || self.has_active_inline_completion(cx) {
return None;
}