mirror of
https://github.com/atuinsh/atuin.git
synced 2025-02-13 17:11:29 +01:00
feat(ui): Add config setting for showing tabs (#1755)
* Add config setting for showing tabs * Added semicolon
This commit is contained in:
parent
515f78fa4c
commit
9933220dac
@ -122,6 +122,9 @@
|
||||
## amount of commands in your history.
|
||||
# show_help = true
|
||||
|
||||
## Configure whether or not to show tabs for search and inspect
|
||||
# show_tabs = true
|
||||
|
||||
## Defaults to true. This matches history against a set of default regex, and will not save it if we get a match. Defaults include
|
||||
## 1. AWS key id
|
||||
## 2. Github pat (old and new)
|
||||
|
@ -354,6 +354,7 @@ pub struct Settings {
|
||||
pub show_preview: bool,
|
||||
pub max_preview_height: u16,
|
||||
pub show_help: bool,
|
||||
pub show_tabs: bool,
|
||||
pub exit_mode: ExitMode,
|
||||
pub keymap_mode: KeymapMode,
|
||||
pub keymap_mode_shell: KeymapMode,
|
||||
@ -593,6 +594,7 @@ impl Settings {
|
||||
.set_default("show_preview", false)?
|
||||
.set_default("max_preview_height", 4)?
|
||||
.set_default("show_help", true)?
|
||||
.set_default("show_tabs", true)?
|
||||
.set_default("invert", false)?
|
||||
.set_default("exit_mode", "return-original")?
|
||||
.set_default("word_jump_mode", "emacs")?
|
||||
|
@ -522,6 +522,7 @@ impl State {
|
||||
1
|
||||
};
|
||||
let show_help = settings.show_help && (!compact || f.size().height > 1);
|
||||
let show_tabs = settings.show_tabs;
|
||||
let chunks = Layout::default()
|
||||
.direction(Direction::Vertical)
|
||||
.margin(0)
|
||||
@ -532,13 +533,13 @@ impl State {
|
||||
Constraint::Length(1 + border_size), // input
|
||||
Constraint::Min(1), // results list
|
||||
Constraint::Length(preview_height), // preview
|
||||
Constraint::Length(1), // tabs
|
||||
Constraint::Length(if show_tabs { 1 } else { 0 }), // tabs
|
||||
Constraint::Length(if show_help { 1 } else { 0 }), // header (sic)
|
||||
]
|
||||
} else {
|
||||
[
|
||||
Constraint::Length(if show_help { 1 } else { 0 }), // header
|
||||
Constraint::Length(1), // tabs
|
||||
Constraint::Length(if show_tabs { 1 } else { 0 }), // tabs
|
||||
Constraint::Min(1), // results list
|
||||
Constraint::Length(1 + border_size), // input
|
||||
Constraint::Length(preview_height), // preview
|
||||
|
Loading…
Reference in New Issue
Block a user