edit prediction: Do not show icon as disabled when there is no buffer open (#24458)

Release Notes:

- N/A
This commit is contained in:
Bennet Bo Fenner
2025-02-07 17:02:14 +00:00
committed by GitHub
parent a6e15dda4b
commit f0565b4e2e
@@ -229,7 +229,7 @@ impl Render for InlineCompletionButton {
return div(); return div();
} }
let enabled = self.editor_enabled.unwrap_or(false); let enabled = self.editor_enabled.unwrap_or(true);
let zeta_icon = if enabled { let zeta_icon = if enabled {
IconName::ZedPredict IconName::ZedPredict
@@ -469,9 +469,7 @@ impl InlineCompletionButton {
}), }),
); );
if self.file.as_ref().map_or(false, |file| { if !self.editor_enabled.unwrap_or(true) {
!all_language_settings(Some(file), cx).inline_completions_enabled_for_path(file.path())
}) {
menu = menu.item( menu = menu.item(
ContextMenuEntry::new("This file is excluded.") ContextMenuEntry::new("This file is excluded.")
.disabled(true) .disabled(true)