diff options
Diffstat (limited to 'helix-term/src/ui/menu.rs')
-rw-r--r-- | helix-term/src/ui/menu.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/helix-term/src/ui/menu.rs b/helix-term/src/ui/menu.rs index bdad2e40..c73e7bed 100644 --- a/helix-term/src/ui/menu.rs +++ b/helix-term/src/ui/menu.rs @@ -11,7 +11,7 @@ pub use tui::widgets::{Cell, Row}; use fuzzy_matcher::skim::SkimMatcherV2 as Matcher; use fuzzy_matcher::FuzzyMatcher; -use helix_view::{graphics::Rect, Editor}; +use helix_view::{editor::SmartTabConfig, graphics::Rect, Editor}; use tui::layout::Constraint; pub trait Item { @@ -247,6 +247,21 @@ impl<T: Item + 'static> Component for Menu<T> { compositor.pop(); })); + // Ignore tab key when supertab is turned on in order not to interfere + // with it. (Is there a better way to do this?) + if (event == key!(Tab) || event == shift!(Tab)) + && cx.editor.config().auto_completion + && matches!( + cx.editor.config().smart_tab, + Some(SmartTabConfig { + enable: true, + supersede_menu: true, + }) + ) + { + return EventResult::Ignored(None); + } + match event { // esc or ctrl-c aborts the completion and closes the menu key!(Esc) | ctrl!('c') => { |