https://github.com/python/cpython/commit/bf8e5e53d0c359a1f9c285d855e7a5e9b6d91375
commit: bf8e5e53d0c359a1f9c285d855e7a5e9b6d91375
branch: main
author: Lysandros Nikolaou <[email protected]>
committer: lysnikolaou <[email protected]>
date: 2024-06-04T19:26:44+02:00
summary:
gh-120041: Refactor check for visible completion menu in completing_reader
(#120055)
files:
M Lib/_pyrepl/commands.py
M Lib/_pyrepl/completing_reader.py
diff --git a/Lib/_pyrepl/commands.py b/Lib/_pyrepl/commands.py
index b967f5206614f8..2ef5dada9d9e58 100644
--- a/Lib/_pyrepl/commands.py
+++ b/Lib/_pyrepl/commands.py
@@ -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
diff --git a/Lib/_pyrepl/completing_reader.py b/Lib/_pyrepl/completing_reader.py
index 215ad8753c9f8b..8df35ccb9117b1 100644
--- a/Lib/_pyrepl/completing_reader.py
+++ b/Lib/_pyrepl/completing_reader.py
@@ -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:
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]