From 65210eec29e829922bd80d6bc36e9dd9ee969614 Mon Sep 17 00:00:00 2001 From: Martin Skarzynski Date: Sat, 10 Oct 2020 22:08:00 -0400 Subject: [PATCH] disable tab_apply_completion (tac) by default and rename as auto_complete_commit_on_tab (accot) --- radian/key_bindings.py | 24 ++++++++++++------------ radian/settings.py | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/radian/key_bindings.py b/radian/key_bindings.py index 46fab27..00b796e 100644 --- a/radian/key_bindings.py +++ b/radian/key_bindings.py @@ -345,8 +345,8 @@ def is_callable(text=""): return False @Condition - def tac(): - return settings.tab_apply_completion + def accot(): + return settings.auto_complete_commit_on_tab insert_mode = vi_insert_mode | emacs_insert_mode focused_insert = insert_mode & has_focus(DEFAULT_BUFFER) @@ -354,8 +354,8 @@ def tac(): alt_enter = [KeyPress(Keys.Escape), KeyPress(Keys.Enter)] # apply selected completion - @handle('c-j', filter=focused_insert & completion_is_selected & tac) - @handle("enter", filter=focused_insert & completion_is_selected & tac) + @handle('c-j', filter=focused_insert & completion_is_selected & accot) + @handle("enter", filter=focused_insert & completion_is_selected & accot) def _(event): b = event.current_buffer text = b.text @@ -367,8 +367,8 @@ def _(event): event.cli.key_processor.feed_multiple(alt_enter) # apply first completion option when completion menu is showing - @handle('c-j', filter=focused_insert & shown_not_selected & tac) - @handle("enter", filter=focused_insert & shown_not_selected & tac) + @handle('c-j', filter=focused_insert & shown_not_selected & accot) + @handle("enter", filter=focused_insert & shown_not_selected & accot) def _(event): b = event.current_buffer text = b.text @@ -381,8 +381,8 @@ def _(event): event.cli.key_processor.feed_multiple(alt_enter) # apply completion if there is only one option, otherwise start completion - @handle("tab", filter=focused_insert & ~has_completions & tac) - @handle("c-space", filter=focused_insert & ~has_completions & tac) + @handle("tab", filter=focused_insert & ~has_completions & accot) + @handle("c-space", filter=focused_insert & ~has_completions & accot) def _(event): b = event.current_buffer complete_event = CompleteEvent(completion_requested=True) @@ -397,8 +397,8 @@ def _(event): b.start_completion(insert_common_part=True) # apply first completion option if completion menu is showing - @handle("tab", filter=focused_insert & shown_not_selected & tac) - @handle("c-space", filter=focused_insert & shown_not_selected & tac) + @handle("tab", filter=focused_insert & shown_not_selected & accot) + @handle("c-space", filter=focused_insert & shown_not_selected & accot) def _(event): b = event.current_buffer b.complete_next() @@ -408,8 +408,8 @@ def _(event): b.cursor_left() # apply selected completion option - @handle("tab", filter=focused_insert & completion_is_selected & tac) - @handle("c-space", filter=focused_insert & completion_is_selected & tac) + @handle("tab", filter=focused_insert & completion_is_selected & accot) + @handle("c-space", filter=focused_insert & completion_is_selected & accot) def _(event): b = event.current_buffer completion = b.complete_state.current_completion diff --git a/radian/settings.py b/radian/settings.py index ccb4aa5..48258f9 100644 --- a/radian/settings.py +++ b/radian/settings.py @@ -37,7 +37,7 @@ def _load_prompt(self): def load(self): self._load_setting("auto_suggest", True, bool) - self._load_setting("tab_apply_completion", True, bool) + self._load_setting("auto_complete_commit_on_tab", False, bool) self._load_setting("editing_mode", "emacs") self._load_setting("color_scheme", "native") self._load_setting("auto_match", True, bool)