inline completions: Add action to toggle inline completions (#16947)
This adds a new action: `editor: toggle inline completions`. It allows users to toggle inline completions on/off for the current buffer. That toggling is not persistent and when the editor is closed, it's gone. That makes it easy to disable inline completions for a single text buffer, for example, even if you want them on for other buffers. When toggling on/off, the toggling also overwrites any language settings. So if you have inline completions disabled for Go buffers, toggling them on takes precedence over those settings. Release Notes: - Added a new editor action to allow toggling inline completions (Copilot, Supermaven) on and off for the current buffer, taking precedence over any settings. Co-authored-by: Antonio <antonio@zed.dev>
This commit is contained in:
@@ -1136,7 +1136,7 @@ impl InlineAssistant {
|
||||
editor.set_show_gutter(false, cx);
|
||||
editor.scroll_manager.set_forbid_vertical_scroll(true);
|
||||
editor.set_read_only(true);
|
||||
editor.set_show_inline_completions(false);
|
||||
editor.set_show_inline_completions(Some(false), cx);
|
||||
editor.highlight_rows::<DeletedLines>(
|
||||
Anchor::min()..=Anchor::max(),
|
||||
Some(cx.theme().status().deleted_background),
|
||||
|
||||
@@ -495,7 +495,7 @@ impl PromptLibrary {
|
||||
editor.set_text(prompt_metadata.title.unwrap_or_default(), cx);
|
||||
if prompt_id.is_built_in() {
|
||||
editor.set_read_only(true);
|
||||
editor.set_show_inline_completions(false);
|
||||
editor.set_show_inline_completions(Some(false), cx);
|
||||
}
|
||||
editor
|
||||
});
|
||||
@@ -510,7 +510,7 @@ impl PromptLibrary {
|
||||
let mut editor = Editor::for_buffer(buffer, None, cx);
|
||||
if prompt_id.is_built_in() {
|
||||
editor.set_read_only(true);
|
||||
editor.set_show_inline_completions(false);
|
||||
editor.set_show_inline_completions(Some(false), cx);
|
||||
}
|
||||
editor.set_soft_wrap_mode(SoftWrap::EditorWidth, cx);
|
||||
editor.set_show_gutter(false, cx);
|
||||
|
||||
@@ -78,7 +78,7 @@ impl WorkflowStepView {
|
||||
editor.set_show_wrap_guides(false, cx);
|
||||
editor.set_show_indent_guides(false, cx);
|
||||
editor.set_read_only(true);
|
||||
editor.set_show_inline_completions(false);
|
||||
editor.set_show_inline_completions(Some(false), cx);
|
||||
editor.insert_blocks(
|
||||
[
|
||||
BlockProperties {
|
||||
|
||||
Reference in New Issue
Block a user