Skip to content

Commit f5bad69

Browse files
committed
disable tab_apply_completion (tac) by default and rename as auto_complete_commit_on_tab (accot)
1 parent f6541ad commit f5bad69

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

radian/key_bindings.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -413,17 +413,17 @@ def is_callable(text=""):
413413
return False
414414

415415
@Condition
416-
def tac():
417-
return settings.tab_apply_completion
416+
def accot():
417+
return settings.auto_complete_commit_on_tab
418418

419419
insert_mode = vi_insert_mode | emacs_insert_mode
420420
focused_insert = insert_mode & has_focus(DEFAULT_BUFFER)
421421
shown_not_selected = has_completions & ~completion_is_selected
422422
alt_enter = [KeyPress(Keys.Escape), KeyPress(Keys.Enter)]
423423

424424
# apply selected completion
425-
@handle('c-j', filter=focused_insert & completion_is_selected & tac)
426-
@handle("enter", filter=focused_insert & completion_is_selected & tac)
425+
@handle('c-j', filter=focused_insert & completion_is_selected & accot)
426+
@handle("enter", filter=focused_insert & completion_is_selected & accot)
427427
def _(event):
428428
b = event.current_buffer
429429
text = b.text
@@ -435,8 +435,8 @@ def _(event):
435435
event.cli.key_processor.feed_multiple(alt_enter)
436436

437437
# apply first completion option when completion menu is showing
438-
@handle('c-j', filter=focused_insert & shown_not_selected & tac)
439-
@handle("enter", filter=focused_insert & shown_not_selected & tac)
438+
@handle('c-j', filter=focused_insert & shown_not_selected & accot)
439+
@handle("enter", filter=focused_insert & shown_not_selected & accot)
440440
def _(event):
441441
b = event.current_buffer
442442
text = b.text
@@ -449,8 +449,8 @@ def _(event):
449449
event.cli.key_processor.feed_multiple(alt_enter)
450450

451451
# apply completion if there is only one option, otherwise start completion
452-
@handle("tab", filter=focused_insert & ~has_completions & tac)
453-
@handle("c-space", filter=focused_insert & ~has_completions & tac)
452+
@handle("tab", filter=focused_insert & ~has_completions & accot)
453+
@handle("c-space", filter=focused_insert & ~has_completions & accot)
454454
def _(event):
455455
b = event.current_buffer
456456
complete_event = CompleteEvent(completion_requested=True)
@@ -465,8 +465,8 @@ def _(event):
465465
b.start_completion(insert_common_part=True)
466466

467467
# apply first completion option if completion menu is showing
468-
@handle("tab", filter=focused_insert & shown_not_selected & tac)
469-
@handle("c-space", filter=focused_insert & shown_not_selected & tac)
468+
@handle("tab", filter=focused_insert & shown_not_selected & accot)
469+
@handle("c-space", filter=focused_insert & shown_not_selected & accot)
470470
def _(event):
471471
b = event.current_buffer
472472
b.complete_next()
@@ -476,8 +476,8 @@ def _(event):
476476
b.cursor_left()
477477

478478
# apply selected completion option
479-
@handle("tab", filter=focused_insert & completion_is_selected & tac)
480-
@handle("c-space", filter=focused_insert & completion_is_selected & tac)
479+
@handle("tab", filter=focused_insert & completion_is_selected & accot)
480+
@handle("c-space", filter=focused_insert & completion_is_selected & accot)
481481
def _(event):
482482
b = event.current_buffer
483483
completion = b.complete_state.current_completion

radian/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def _load_prompt(self):
3838
def load(self):
3939
self._load_setting("auto_suggest", True, bool)
4040
self._load_setting("emacs_bindings_in_vi_insert_mode", True, bool)
41-
self._load_setting("tab_apply_completion", True, bool)
41+
self._load_setting("auto_complete_commit_on_tab", False, bool)
4242
self._load_setting("editing_mode", "emacs")
4343
self._load_setting("color_scheme", "native")
4444
self._load_setting("auto_match", True, bool)

0 commit comments

Comments
 (0)