Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adapt help to enter_accept config #2001

Merged
merged 1 commit into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions crates/atuin/src/command/client/search/interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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![
Expand All @@ -771,7 +771,11 @@ impl State {
Span::raw(": edit"),
Span::raw(", "),
Span::styled("<enter>", Style::default().add_modifier(Modifier::BOLD)),
Span::raw(": run"),
Span::raw(if settings.enter_accept {
": run"
} else {
": edit"
}),
Span::raw(", "),
Span::styled("<ctrl-o>", Style::default().add_modifier(Modifier::BOLD)),
Span::raw(": inspect"),
Expand Down
Loading