diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index fd6e309567de39..b1192e7bb46552 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -142,7 +142,9 @@ Replace... Open a search-and-replace dialog. Go to Line - Move cursor to the line number requested and make that line visible. + Move the cursor to the beginning of the line requested and make that + line visible. A request past the end of the file goes to the end. + Clear any selection and update the line and column status. Show Completions Open a scrollable list allowing selection of keywords and attributes. See diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 0651b3d68dc8b1..1e6cd4580ea7bc 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,6 +3,9 @@ Released on 2020-10-05? ====================================== +bpo-39852: Edit "Go to line" now clears any selection, preventing +accidental deletion. It also updates Ln and Col on the status bar. + bpo-39781: Selecting code context lines no longer causes a jump. bpo-39663: Add tests for pyparse find_good_parse_start(). diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py index 04c786dc5234c2..5b81b52f9196c4 100644 --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -678,8 +678,11 @@ def goto_line_event(self, event): if lineno <= 0: text.bell() return "break" - text.mark_set("insert", "%d.0" % lineno) + + text.tag_remove("sel", "1.0", "end") + text.mark_set("insert", f'{lineno}.0') text.see("insert") + self.set_line_and_column() return "break" def open_module(self): diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 0b2bdd2e174ccf..424c6b50f339e1 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -4,7 +4,7 @@ - IDLE — Python 3.9.0a1 documentation + IDLE — Python 3.9.0a4 documentation @@ -17,7 +17,7 @@ @@ -71,7 +71,7 @@

Navigation

  • - 3.9.0a1 Documentation » + 3.9.0a4 Documentation »
  • @@ -197,7 +197,9 @@

    Edit menu (Shell and Editor)Completions in the Editing and navigation section below.

    @@ -635,17 +637,20 @@

    Startup failure~/.idlerc/ (~ is one’s home directory). If there is a problem, an error message should be displayed. Leaving aside random disk glitches, this can -be prevented by never editing the files by hand, using the configuration -dialog, under Options, instead Options. Once it happens, the solution may -be to delete one or more of the configuration files.

    +be prevented by never editing the files by hand. Instead, use the +configuration dialog, under Options. Once there is an error in a user +configuration file, the best solution may be to delete it and start over +with the settings dialog.

    If IDLE quits with no message, and it was not started from a console, try -starting from a console (python -m idlelib) and see if a message appears.

    +starting it from a console or terminal (python -m idlelib) and see if +this results in an error message.

    Running user code

    @@ -930,7 +935,7 @@

    Navigation

  • - 3.9.0a1 Documentation » + 3.9.0a4 Documentation »
  • @@ -953,7 +958,7 @@

    Navigation