diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 5e9ca3d887a5..7fe8cb6061a7 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -583,10 +583,10 @@ impl Component for Picker { cx.editor.reset_idle_timer(); match key_event { - shift!(Tab) | key!(Up) | ctrl!('p') => { + shift!(Tab) | key!(Up) | ctrl!('p') | ctrl!('k') => { self.move_by(1, Direction::Backward); } - key!(Tab) | key!(Down) | ctrl!('n') => { + key!(Tab) | key!(Down) | ctrl!('n') | ctrl!('j') => { self.move_by(1, Direction::Forward); } key!(PageDown) | ctrl!('d') => { diff --git a/helix-term/src/ui/statusline.rs b/helix-term/src/ui/statusline.rs index 501faea3963e..76b3efca2002 100644 --- a/helix-term/src/ui/statusline.rs +++ b/helix-term/src/ui/statusline.rs @@ -164,6 +164,15 @@ where let visible = context.focused; let config = context.editor.config(); let modenames = &config.statusline.mode; + let mode_style = if visible && config.color_modes { + match context.editor.mode() { + Mode::Insert => Some(context.editor.theme.get("ui.statusline.insert")), + Mode::Select => Some(context.editor.theme.get("ui.statusline.select")), + Mode::Normal => Some(context.editor.theme.get("ui.statusline.normal")), + } + } else { + None + }; write( context, format!( @@ -179,16 +188,25 @@ where " " } ), - if visible && config.color_modes { - match context.editor.mode() { - Mode::Insert => Some(context.editor.theme.get("ui.statusline.insert")), - Mode::Select => Some(context.editor.theme.get("ui.statusline.select")), - Mode::Normal => Some(context.editor.theme.get("ui.statusline.normal")), - } - } else { - None - }, + mode_style, ); + + if visible { + match &config.statusline.mode_separator { + separator if separator.is_empty() => {} + separator => { + // use mode style as mode separator style except set + // background to statusline background + let mode_separator_style = mode_style.map(|s| Style { + fg: s.bg, + bg: context.editor.theme.get("ui.statusline").bg, + ..Default::default() + }); + + write(context, separator.to_string(), mode_separator_style); + } + }; + } } fn render_lsp_spinner(context: &mut RenderContext, write: F) diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 973cf82ea109..36f6724ada63 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -271,6 +271,8 @@ pub struct StatusLineConfig { pub right: Vec, pub separator: String, pub mode: ModeConfig, + /// Seperator after statusline mode. Best used with 'color-modes = true'. Defaults to "". + pub mode_separator: String, } impl Default for StatusLineConfig { @@ -283,6 +285,7 @@ impl Default for StatusLineConfig { right: vec![E::Diagnostics, E::Selections, E::Position, E::FileEncoding], separator: String::from("│"), mode: ModeConfig::default(), + mode_separator: String::from(""), } } }