mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-09 20:04:25 +00:00
assistant: Fix prompts not being editable (#15796)
Fixes a bug introduced in #15615, where prompts could not be edited in the prompt library. This PR fixes the behavior by only preventing users to edit built-in prompts. Release Notes: - N/A
This commit is contained in:
parent
559ce87b4e
commit
d9977718d2
1 changed files with 2 additions and 2 deletions
|
@ -487,7 +487,7 @@ impl PromptLibrary {
|
||||||
let mut editor = Editor::auto_width(cx);
|
let mut editor = Editor::auto_width(cx);
|
||||||
editor.set_placeholder_text("Untitled", cx);
|
editor.set_placeholder_text("Untitled", cx);
|
||||||
editor.set_text(prompt_metadata.title.unwrap_or_default(), cx);
|
editor.set_text(prompt_metadata.title.unwrap_or_default(), cx);
|
||||||
editor.set_read_only(true);
|
editor.set_read_only(prompt_id.is_built_in());
|
||||||
editor
|
editor
|
||||||
});
|
});
|
||||||
let body_editor = cx.new_view(|cx| {
|
let body_editor = cx.new_view(|cx| {
|
||||||
|
@ -499,7 +499,7 @@ impl PromptLibrary {
|
||||||
});
|
});
|
||||||
|
|
||||||
let mut editor = Editor::for_buffer(buffer, None, cx);
|
let mut editor = Editor::for_buffer(buffer, None, cx);
|
||||||
editor.set_read_only(true);
|
editor.set_read_only(prompt_id.is_built_in());
|
||||||
editor.set_soft_wrap_mode(SoftWrap::EditorWidth, cx);
|
editor.set_soft_wrap_mode(SoftWrap::EditorWidth, cx);
|
||||||
editor.set_show_gutter(false, cx);
|
editor.set_show_gutter(false, cx);
|
||||||
editor.set_show_wrap_guides(false, cx);
|
editor.set_show_wrap_guides(false, cx);
|
||||||
|
|
Loading…
Reference in a new issue