Skip to content

Commit bf8e5e5

Browse files
authored
gh-120041: Refactor check for visible completion menu in completing_reader (#120055)
1 parent e079935 commit bf8e5e5

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Lib/_pyrepl/commands.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,7 @@ def do(self) -> None:
365365
r = self.reader
366366
text = self.event * r.get_arg()
367367
r.insert(text)
368-
if (
369-
len(text) == 1 and
370-
r.pos == len(r.buffer) and
371-
not r.cmpltn_menu_visible and # type: ignore[attr-defined]
372-
not r.cmpltn_message_visible # type: ignore[attr-defined]
373-
):
368+
if len(text) == 1 and r.pos == len(r.buffer):
374369
r.calc_screen = r.append_to_screen
375370

376371

Lib/_pyrepl/completing_reader.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ def do(self) -> None:
210210

211211
commands.self_insert.do(self)
212212

213+
if r.cmpltn_menu_visible or r.cmpltn_message_visible:
214+
r.calc_screen = r.calc_complete_screen
215+
213216
if r.cmpltn_menu_visible:
214217
stem = r.get_stem()
215218
if len(stem) < 1:

0 commit comments

Comments
 (0)