diff options
| author | Aram Drevekenin <aram@poor.dev> | 2024-10-23 17:34:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-23 17:34:41 +0200 |
| commit | b71be135c2b69dce244440491b693747764a4151 (patch) | |
| tree | 8513ea05d7ab79bde388b32f2487d752fcf95b56 /default-plugins/plugin-manager | |
| parent | docs(changelog): ui touch-ups (diff) | |
| download | sl0ppij-b71be135c2b69dce244440491b693747764a4151.tar.gz sl0ppij-b71be135c2b69dce244440491b693747764a4151.tar.xz sl0ppij-b71be135c2b69dce244440491b693747764a4151.zip | |
fix(plugins): rebind insert (#3692)
* fix(tab): recover from closing a pane outside the viewport
* remap insert in plugin manager
* fix(plugins): remap insert key
* style(fmt): rustfmt
Diffstat (limited to 'default-plugins/plugin-manager')
| -rw-r--r-- | default-plugins/plugin-manager/src/main.rs | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/default-plugins/plugin-manager/src/main.rs b/default-plugins/plugin-manager/src/main.rs index 7cd5e5c4..3695b59f 100644 --- a/default-plugins/plugin-manager/src/main.rs +++ b/default-plugins/plugin-manager/src/main.rs @@ -841,29 +841,33 @@ impl State { tab_line } pub fn render_help(&self, y: usize, cols: usize) { - let full_text = "Help: <←↓↑→> - Navigate/Expand, <ENTER> - focus, <TAB> - Reload, <Del> - Close, <INSERT> - New"; + let full_text = "Help: <←↓↑→> - Navigate/Expand, <ENTER> - focus, <TAB> - Reload, <Del> - Close, <Ctrl a> - New, <ESC> - Exit"; let middle_text = - "Help: <←↓↑→/ENTER> - Navigate, <TAB> - Reload, <Del> - Close, <INSERT> - New"; - let short_text = "<←↓↑→/ENTER/TAB/Del> - Navigate/Expand/Reload/Close, <INSERT> - New"; + "Help: <←↓↑→/ENTER> - Navigate, <TAB> - Reload, <Del> - Close, <Ctrl a> - New, <ESC> - Exit"; + let short_text = + "<←↓↑→/ENTER/TAB/Del> - Navigate/Expand/Reload/Close, <Ctrl a> - New, <ESC> - Exit"; if cols >= full_text.chars().count() { let text = Text::new(full_text) .color_range(3, 5..=11) .color_range(3, 32..=38) .color_range(3, 49..=53) .color_range(3, 65..=69) - .color_range(3, 80..=87); + .color_range(3, 80..=87) + .color_range(3, 96..=100); print_text_with_coordinates(text, 0, y, Some(cols), None); } else if cols >= middle_text.chars().count() { let text = Text::new(middle_text) .color_range(3, 6..=17) .color_range(3, 31..=35) .color_range(3, 47..=51) - .color_range(3, 62..=69); + .color_range(3, 62..=69) + .color_range(3, 78..=82); print_text_with_coordinates(text, 0, y, Some(cols), None); } else { let text = Text::new(short_text) .color_range(3, ..=21) - .color_range(3, 53..=60); + .color_range(3, 53..=60) + .color_range(3, 69..=73); print_text_with_coordinates(text, 0, y, Some(cols), None); } } @@ -989,7 +993,7 @@ impl State { BareKey::Tab if key.has_no_modifiers() => { self.reload_selected(); }, - BareKey::Insert if key.has_no_modifiers() => { + BareKey::Char('a') if key.has_modifiers(&[KeyModifier::Ctrl]) => { self.new_plugin_screen = Some(Default::default()); should_render = true; }, @@ -997,9 +1001,13 @@ impl State { self.close_selected(); }, BareKey::Esc if key.has_no_modifiers() => { - self.search_term.clear(); - self.update_search_term(); - should_render = true; + if !self.search_term.is_empty() { + self.search_term.clear(); + self.update_search_term(); + should_render = true; + } else { + close_self(); + } }, _ => {}, } |
