From a266661a1ddf81493c5ff7cfe981a6c7e6ed7ea7 Mon Sep 17 00:00:00 2001 From: "Alexis (Poliorcetics) Bourget" Date: Sat, 4 May 2024 19:57:55 +0200 Subject: [PATCH] fix: adapt help to `enter_accept` config --- crates/atuin/src/command/client/search/interactive.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/atuin/src/command/client/search/interactive.rs b/crates/atuin/src/command/client/search/interactive.rs index 7a3a834b27a..3ba4f5c3ced 100644 --- a/crates/atuin/src/command/client/search/interactive.rs +++ b/crates/atuin/src/command/client/search/interactive.rs @@ -674,7 +674,7 @@ impl State { let title = self.build_title(); f.render_widget(title, header_chunks[0]); - let help = self.build_help(); + let help = self.build_help(settings); f.render_widget(help, header_chunks[1]); let stats_tab = self.build_stats(); @@ -760,7 +760,7 @@ impl State { } #[allow(clippy::unused_self)] - fn build_help(&self) -> Paragraph { + fn build_help(&self, settings: &Settings) -> Paragraph { match self.tab_index { // search 0 => Paragraph::new(Text::from(Line::from(vec![ @@ -771,7 +771,11 @@ impl State { Span::raw(": edit"), Span::raw(", "), Span::styled("", Style::default().add_modifier(Modifier::BOLD)), - Span::raw(": run"), + Span::raw(if settings.enter_accept { + ": run" + } else { + ": edit" + }), Span::raw(", "), Span::styled("", Style::default().add_modifier(Modifier::BOLD)), Span::raw(": inspect"),