Skip to content

Commit

Permalink
show "wait" number only when "no hint"
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoine committed Apr 19, 2024
1 parent 9abf1f2 commit df2f3ca
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ fn render_status_bar(frame: &mut Frame, app: &App) {
bottom_bar_rect,
);

if app.config.show_hints {
if app.config.show_hints || matches!(app.mode, Mode::Waiting(..)) {
let hints = match app.mode {
Mode::Normal => format!(
"{} to {} | {}{}{}{} to move around | {} to peek | {} to transpose | {} to quit",
Expand All @@ -685,11 +685,17 @@ fn render_status_bar(frame: &mut Frame, app: &App) {
repr_key(&config.keybindings.transpose),
repr_key(&config.keybindings.quit),
),
Mode::Waiting(n) => format!(
"{} to quit | will run next motion {} times",
repr_key(&KeyEvent::new(KeyCode::Esc, KeyModifiers::NONE)),
n
),
Mode::Waiting(n) => {
if app.config.show_hints {
format!(
"{} to quit | will run next motion {} times",
repr_key(&KeyEvent::new(KeyCode::Esc, KeyModifiers::NONE)),
n
)
} else {
format!("{}", n)
}
},
Mode::Insert => format!(
"{} to quit | {}{}{}{} to move the cursor | {}{} to delete characters | {} to confirm",
repr_key(&KeyEvent::new(KeyCode::Esc, KeyModifiers::NONE)),
Expand Down

0 comments on commit df2f3ca

Please sign in to comment.