From a28e9a01468f581286069405791465f239b18975 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 16 Aug 2025 06:55:39 +0530 Subject: [PATCH] Fix infinite recursion in readline completer --- tools/tui/readline/completion.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tui/readline/completion.go b/tools/tui/readline/completion.go index c3ff0155f..1f37df37e 100644 --- a/tools/tui/readline/completion.go +++ b/tools/tui/readline/completion.go @@ -113,7 +113,7 @@ func (self *Readline) complete(forwards bool, repeat_count uint) bool { self.input_state.lines[self.input_state.cursor.Y] += al[0] self.input_state.lines = append(self.input_state.lines, al[1:]...) } - if c.current.num_of_matches == 1 && self.AllText() == all_text_before_completion { + if c.current.num_of_matches == 1 && self.AllText() == all_text_before_completion && repeat_count > 0 { // when there is only a single match and it has already been inserted there is no point iterating over current completions orig := self.last_action self.last_action = ActionNil