Hide Inline Assist button if assistant.button is disabled (#7932)

This PR adds check for `assistant.button` setting in quick bar, to hide
it when the setting is set to false. It seems that the setting can be a
separate one, I would be happy to add it if needed.

Release Notes:

- Improved `assistant.button` setting so that `Inline Assist` button in
editor quick bar is also hidden
([#4500](https://github.com/zed-industries/zed/issues/4500)).
This commit is contained in:
Aleksei Trifonov 2024-02-18 09:14:08 +03:00 committed by GitHub
parent 6d9b8cc595
commit a041e07c99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,5 @@
pub mod assistant_panel;
mod assistant_settings;
pub mod assistant_settings;
mod codegen;
mod prompts;
mod streaming_diff;

View File

@ -1,3 +1,4 @@
use assistant::assistant_settings::AssistantSettings;
use assistant::{AssistantPanel, InlineAssist};
use editor::{Editor, EditorSettings};
@ -126,7 +127,9 @@ impl Render for QuickActionBar {
.gap_2()
.children(inlay_hints_button)
.children(search_button)
.child(assistant_button)
.when(AssistantSettings::get_global(cx).button, |bar| {
bar.child(assistant_button)
})
}
}