Misc cleanup + clear language model provider API key editors when API keys are submitted (#38165)
Followup to #38163 along with some other misc cleanups Release Notes: - N/A
This commit is contained in:
@@ -9,6 +9,7 @@ use component::{example_group, single_example};
|
||||
use editor::{Editor, EditorElement, EditorStyle};
|
||||
use gpui::{App, Entity, FocusHandle, Focusable, FontStyle, Hsla, TextStyle};
|
||||
use settings::Settings;
|
||||
use std::sync::Arc;
|
||||
use theme::ThemeSettings;
|
||||
use ui::prelude::*;
|
||||
|
||||
@@ -101,6 +102,11 @@ impl SingleLineInput {
|
||||
pub fn text(&self, cx: &App) -> String {
|
||||
self.editor().read(cx).text(cx)
|
||||
}
|
||||
|
||||
pub fn set_text(&self, text: impl Into<Arc<str>>, window: &mut Window, cx: &mut App) {
|
||||
self.editor()
|
||||
.update(cx, |editor, cx| editor.set_text(text, window, cx))
|
||||
}
|
||||
}
|
||||
|
||||
impl Render for SingleLineInput {
|
||||
|
||||
Reference in New Issue
Block a user