Skip to content

Commit

Permalink
pythongh-120041: Refactor check for visible completion menu in comple…
Browse files Browse the repository at this point in the history
…ting_reader (python#120055)
  • Loading branch information
lysnikolaou authored Jun 4, 2024
1 parent e079935 commit bf8e5e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 1 addition & 6 deletions Lib/_pyrepl/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,7 @@ def do(self) -> None:
r = self.reader
text = self.event * r.get_arg()
r.insert(text)
if (
len(text) == 1 and
r.pos == len(r.buffer) and
not r.cmpltn_menu_visible and # type: ignore[attr-defined]
not r.cmpltn_message_visible # type: ignore[attr-defined]
):
if len(text) == 1 and r.pos == len(r.buffer):
r.calc_screen = r.append_to_screen


Expand Down
3 changes: 3 additions & 0 deletions Lib/_pyrepl/completing_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ def do(self) -> None:

commands.self_insert.do(self)

if r.cmpltn_menu_visible or r.cmpltn_message_visible:
r.calc_screen = r.calc_complete_screen

if r.cmpltn_menu_visible:
stem = r.get_stem()
if len(stem) < 1:
Expand Down

0 comments on commit bf8e5e5

Please sign in to comment.