fix: adapt help to enter_accept config (#2001)

This commit is contained in:
Poliorcetics 2024-05-06 09:14:51 +02:00 committed by GitHub
parent 754ddeaa8d
commit 467b575007
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -677,7 +677,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();
@ -763,7 +763,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![
@ -774,7 +774,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"),