Derive autocomplete menu's width from the width of its largest item
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
1a6e972ed4
commit
c19d639e0a
5 changed files with 98 additions and 39 deletions
|
@ -292,6 +292,7 @@ pub struct EditorStyle {
|
|||
pub invalid_information_diagnostic: DiagnosticStyle,
|
||||
pub hint_diagnostic: DiagnosticStyle,
|
||||
pub invalid_hint_diagnostic: DiagnosticStyle,
|
||||
pub autocomplete: AutocompleteStyle,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Default)]
|
||||
|
@ -321,6 +322,13 @@ pub struct DiagnosticStyle {
|
|||
pub text_scale_factor: f32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Default)]
|
||||
pub struct AutocompleteStyle {
|
||||
#[serde(flatten)]
|
||||
pub container: ContainerStyle,
|
||||
pub item: ContainerStyle,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Default, Deserialize)]
|
||||
pub struct SelectionStyle {
|
||||
pub cursor: Color,
|
||||
|
@ -408,6 +416,7 @@ impl InputEditorStyle {
|
|||
invalid_information_diagnostic: default_diagnostic_style.clone(),
|
||||
hint_diagnostic: default_diagnostic_style.clone(),
|
||||
invalid_hint_diagnostic: default_diagnostic_style.clone(),
|
||||
autocomplete: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue