fix: remove leader label from pending key sequences

This commit is contained in:
2026-10-11 19:38:47 +02:00
parent 2756b79f89
commit aaaa3875aa
2 changed files with 2 additions and 46 deletions
+1 -1
View File
@@ -318,7 +318,7 @@ Esc or Ctrl+p cancels without changing text, selections, the previous command/se
## Key sequences ## Key sequences
Space begins a leader sequence in Normal/Visual by default. Explicit sequences such as `ctrl+w j` can coexist without changing that leader. Press the keys in order; nested prefixes wait without a timeout. The status bar shows the pending sequence. Esc cancels the sequence and pending count without leaving Visual or collapsing carets. See [sequence configuration](configuration.md#key-sequences-and-leader) for remapping and declaration rules. Space begins a leader sequence in Normal/Visual by default. Explicit sequences such as `ctrl+w j` can coexist without changing that leader. Press the keys in order; nested prefixes wait without a timeout. The status bar shows the pending keys before the file path, without a prefix label. Esc cancels the sequence and pending count without leaving Visual or collapsing carets. See [sequence configuration](configuration.md#key-sequences-and-leader) for remapping and declaration rules.
## Jump history ## Jump history
+1 -45
View File
@@ -1433,7 +1433,7 @@ fn draw_status(frame: &mut Frame, editor: &Editor, syntax: &SyntaxCache, status_
format!(" {}", editor.mode()) format!(" {}", editor.mode())
}; };
if let Some(sequence) = editor.sequence_pending() { if let Some(sequence) = editor.sequence_pending() {
write!(status, " leader: {sequence}").unwrap(); write!(status, " {sequence}").unwrap();
} }
if editor.g_pending() { if editor.g_pending() {
status.push_str(" g"); status.push_str(" g");
@@ -9014,50 +9014,6 @@ end
} }
} }
#[test]
fn pending_leader_is_visible_before_long_paths_and_unknown_keys_do_not_edit() {
let directory = Directory::new();
let path = directory.file(&"long-path-".repeat(12), "keep");
let mut editor = Editor::open(Some(path), vec![]).unwrap();
let mut terminal = Terminal::new(ratatui::backend::TestBackend::new(40, 6)).unwrap();
let (mut top, mut left) = (0, 0);
let mut syntax = SyntaxCache::new();
editor.handle(Input::Char(' '));
editor.handle(Input::Char('b'));
terminal
.draw(|frame| {
draw(
frame,
&editor,
&mut top,
&mut left,
&mut syntax,
&mut DocumentViewport::default(),
&mut WheelPanels::default(),
)
})
.unwrap();
assert!(screen_text(&terminal).contains("leader: Space b"));
editor.handle(Input::Char('x'));
terminal
.draw(|frame| {
draw(
frame,
&editor,
&mut top,
&mut left,
&mut syntax,
&mut DocumentViewport::default(),
&mut WheelPanels::default(),
)
})
.unwrap();
assert!(!screen_text(&terminal).contains("leader:"));
assert_eq!(editor.lines(), &["keep"]);
assert_eq!(editor.cursor(), crate::editor::Cursor::default());
assert_eq!(editor.mode(), Mode::Normal);
}
#[test] #[test]
fn palette_advertises_effective_leader_sequences_after_remapping() { fn palette_advertises_effective_leader_sequences_after_remapping() {
let mut editor = Editor::open(None, vec![]).unwrap(); let mut editor = Editor::open(None, vec![]).unwrap();