mirror of https://github.com/helix-editor/helix
fix: background color
The statusline and the command mode prompt will now both have the same background when the editor.statusline.merge-with-commandline option is setpull/12204/head
parent
da577cf1ac
commit
f506116b38
|
@ -3253,6 +3253,11 @@ pub(super) fn command_mode(cx: &mut Context) {
|
||||||
|
|
||||||
None
|
None
|
||||||
});
|
});
|
||||||
|
if cx.editor.config().statusline.merge_with_commandline {
|
||||||
|
// command line prompt has the same background as the statusline when
|
||||||
|
// the statusline and the command line are merged
|
||||||
|
prompt.background = Some(cx.editor.theme.get("ui.statusline"))
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate initial completion
|
// Calculate initial completion
|
||||||
prompt.recalculate_completion(cx.editor);
|
prompt.recalculate_completion(cx.editor);
|
||||||
|
|
|
@ -28,6 +28,7 @@ pub struct Prompt {
|
||||||
prompt: Cow<'static, str>,
|
prompt: Cow<'static, str>,
|
||||||
line: String,
|
line: String,
|
||||||
cursor: usize,
|
cursor: usize,
|
||||||
|
pub background: Option<helix_view::theme::Style>,
|
||||||
completion: Vec<Completion>,
|
completion: Vec<Completion>,
|
||||||
selection: Option<usize>,
|
selection: Option<usize>,
|
||||||
history_register: Option<char>,
|
history_register: Option<char>,
|
||||||
|
@ -84,6 +85,7 @@ impl Prompt {
|
||||||
selection: None,
|
selection: None,
|
||||||
history_register,
|
history_register,
|
||||||
history_pos: None,
|
history_pos: None,
|
||||||
|
background: None,
|
||||||
completion_fn: Box::new(completion_fn),
|
completion_fn: Box::new(completion_fn),
|
||||||
callback_fn: Box::new(callback_fn),
|
callback_fn: Box::new(callback_fn),
|
||||||
doc_fn: Box::new(|_| None),
|
doc_fn: Box::new(|_| None),
|
||||||
|
@ -401,7 +403,9 @@ impl Prompt {
|
||||||
let completion_color = theme.get("ui.menu");
|
let completion_color = theme.get("ui.menu");
|
||||||
let selected_color = theme.get("ui.menu.selected");
|
let selected_color = theme.get("ui.menu.selected");
|
||||||
let suggestion_color = theme.get("ui.text.inactive");
|
let suggestion_color = theme.get("ui.text.inactive");
|
||||||
let background = theme.get("ui.background");
|
let background = self
|
||||||
|
.background
|
||||||
|
.unwrap_or_else(|| theme.get("ui.background"));
|
||||||
// completion
|
// completion
|
||||||
|
|
||||||
let max_len = self
|
let max_len = self
|
||||||
|
|
Loading…
Reference in New Issue