diff options
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/NEWS.txt | 3 | ||||
-rw-r--r-- | Lib/idlelib/pyparse.py | 2 | ||||
-rw-r--r-- | Lib/idlelib/query.py | 2 | ||||
-rw-r--r-- | Lib/idlelib/replace.py | 4 | ||||
-rw-r--r-- | Lib/idlelib/run.py | 2 |
5 files changed, 8 insertions, 5 deletions
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 34b2c08..0bfadfd 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -4,6 +4,9 @@ Released on 2022-10-03 ========================= +bpo-46630: Make query dialogs on Windows start with a cursor in the +entry box. + bpo-46591: Make the IDLE doc URL on the About IDLE dialog clickable. bpo-45296: Clarify close, quit, and exit in IDLE. In the File menu, diff --git a/Lib/idlelib/pyparse.py b/Lib/idlelib/pyparse.py index a943275..8545c63 100644 --- a/Lib/idlelib/pyparse.py +++ b/Lib/idlelib/pyparse.py @@ -179,7 +179,7 @@ class Parser: # Peeking back worked; look forward until _synchre no longer # matches. i = pos + 1 - while (m := _synchre(code, i)): + while m := _synchre(code, i): s, i = m.span() if not is_char_in_string(s): pos = s diff --git a/Lib/idlelib/query.py b/Lib/idlelib/query.py index fefa5aa..df02f21 100644 --- a/Lib/idlelib/query.py +++ b/Lib/idlelib/query.py @@ -83,6 +83,7 @@ class Query(Toplevel): if not _utest: self.deiconify() # Unhide now that geometry set. + self.entry.focus_set() self.wait_window() def create_widgets(self, ok_text='OK'): # Do not replace. @@ -100,7 +101,6 @@ class Query(Toplevel): text=self.message) self.entryvar = StringVar(self, self.text0) self.entry = Entry(frame, width=30, textvariable=self.entryvar) - self.entry.focus_set() self.error_font = Font(name='TkCaptionFont', exists=True, root=self.parent) self.entry_error = Label(frame, text=' ', foreground='red', diff --git a/Lib/idlelib/replace.py b/Lib/idlelib/replace.py index ac04ed9..ca83173 100644 --- a/Lib/idlelib/replace.py +++ b/Lib/idlelib/replace.py @@ -158,8 +158,8 @@ class ReplaceDialog(SearchDialogBase): first = last = None # XXX ought to replace circular instead of top-to-bottom when wrapping text.undo_block_start() - while (res := self.engine.search_forward( - text, prog, line, col, wrap=False, ok=ok)): + while res := self.engine.search_forward( + text, prog, line, col, wrap=False, ok=ok): line, m = res chars = text.get("%d.0" % line, "%d.0" % (line+1)) orig = m.group() diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 01f8d65..aaa9b5c 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -482,7 +482,7 @@ class StdInputFile(StdioFile): result = self._line_buffer self._line_buffer = '' if size < 0: - while (line := self.shell.readline()): + while line := self.shell.readline(): result += line else: while len(result) < size: |