diff --git a/docs/editing.md b/docs/editing.md index 20917ba..b93446c 100644 --- a/docs/editing.md +++ b/docs/editing.md @@ -318,7 +318,7 @@ Esc or Ctrl+p cancels without changing text, selections, the previous command/se ## 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 diff --git a/src/tui.rs b/src/tui.rs index b823024..5cbd29c 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -1433,7 +1433,7 @@ fn draw_status(frame: &mut Frame, editor: &Editor, syntax: &SyntaxCache, status_ format!(" {}", editor.mode()) }; if let Some(sequence) = editor.sequence_pending() { - write!(status, " leader: {sequence}").unwrap(); + write!(status, " {sequence}").unwrap(); } if editor.g_pending() { 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] fn palette_advertises_effective_leader_sequences_after_remapping() { let mut editor = Editor::open(None, vec![]).unwrap();