Fix assistant hints showing up when selecting \n in Vim mode (#20899)
We also need to check whether the selection is empty, not just whether its head is on an empty line. Release Notes: - N/A Co-authored-by: Antonio <antonio@zed.dev>
This commit is contained in:
parent
e03968f538
commit
743165fa6c
1 changed files with 9 additions and 1 deletions
|
@ -11875,7 +11875,15 @@ impl Editor {
|
||||||
style: &EditorStyle,
|
style: &EditorStyle,
|
||||||
cx: &mut WindowContext,
|
cx: &mut WindowContext,
|
||||||
) -> Option<AnyElement> {
|
) -> 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;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue