You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IDLE: Goto should remove selection and update the status bar #84033
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/terryjreedy'closed_at=<Date2020-03-08.18:51:40.174>created_at=<Date2020-03-04.18:12:17.807>labels= ['3.8', 'expert-IDLE', 'type-bug', '3.7', '3.9']
title='IDLE: Goto should remove selection and update the status bar'updated_at=<Date2020-03-09.20:46:53.135>user='https://bugs.python.org/DaveLiptack'
The standard and expected behavior is that pasting *without* a selection inserts, pasting *with* a selection replaces. Pasting with key, Edit menu, or context menu should be the same. This is what I see and what I *think* you are describing. If so, please close. If not, please specify OS and version, how you installed Python, and more concretely what you did and whether line numbers or code context were present.
DaveLiptack commented on Mar 5, 2020
DaveLiptackmannequin
MannequinAuthor
More actions
OS: Windows 10 Pro
Version: 1909
OS Build: 18363.657
Python 2.7.17 and 3.8.1 were installed from https://www.python.org/downloads/ using the Windows x86-64 executable installer (3.8.1) and Windows x86-64 MSI installer (2.7.17)
Both line numbers and code context are not present
To reproduce:
Position cursor at the start of a line of text
Type Shift+down arrow (to select line of text)
Type Ctrl+c
Type Alt+g (IDLE) or Ctrl+g (Notepad, Notepad++)
Enter line number (for example below line number = 2)
Type Enter
Type Ctrl+v
Example initial text:
# This is line 1
# additional line
# This is a line I wish to duplicate
# another additional line
Resulting text in IDLE:
# This is line 1
# This is a line I wish to duplicate
# additional line
# another additional line
Resulting text in Notepad and Notepad++:
# This is line 1
# This is a line I wish to duplicate
# additional line
# This is a line I wish to duplicate
# another additional line
My workaround in IDLE is to add a step between #6 and #7 above, where I mouse click at the desired paste location
This is much clearer. To expand on what I said before, inserting *anything*, such as by hitting a key, replaces a selection. I verified that this is normal behavior, at least on Windows, with Notepad, Notepad++, and this Firefox entry box I am typing in. So either of your steps 6 or 7 delete the still selected line, after the goto. (And so a click is needed before 6 to stop the deletion.) I see the continued selection as the problem. Both Notepad and Notepad++ unselect any selection upon goto, the same as if one moved the cursor by clicking instead of goto.
I will try adding text.selection_clear() to the goto code.
I have a nit on the commit message used here (and also in bpo-39885). *Please* don't use this style of commit message "IDLE context menu clears selection". That phrasing sounds like it is the description of a bug. Please always use a phrasing that makes it clear what the commit/PR changes. In this case, for example, it could be "IDLE: make context menu clear selection".
I know there are projects that prefer this style. Python is not one of them. Please comply.
Is it the temporal ambiguity (fixed by adding 'now', which is in the blurbs) or the descriptive versus command style (as with 'Returns' versus 'Return') that you do not like? If the latter, the devguide could use augmentation.
I guess it's similar to the 'return' vs. 'returns' issue, but I feel much
stronger about it here.
I would have written that as "make the spam module more spammy". Just read
a bunch of commits using e.g. git log --oneline to see what the
prevailing style is.
Activity
DaveLiptack commentedon Mar 4, 2020
Python 3.8.1
IDLE 3.8.1
When COPYing text in IDLE, right-click and PASTE behaves like CUT/PASTE
This also occurs with COPY -> Go to Line -> PASTE
This does not occur with COPY -> left-click -> PASTE
terryjreedy commentedon Mar 4, 2020
The standard and expected behavior is that pasting *without* a selection inserts, pasting *with* a selection replaces. Pasting with key, Edit menu, or context menu should be the same. This is what I see and what I *think* you are describing. If so, please close. If not, please specify OS and version, how you installed Python, and more concretely what you did and whether line numbers or code context were present.
DaveLiptack commentedon Mar 5, 2020
OS: Windows 10 Pro
Version: 1909
OS Build: 18363.657
Python 2.7.17 and 3.8.1 were installed from https://www.python.org/downloads/ using the Windows x86-64 executable installer (3.8.1) and Windows x86-64 MSI installer (2.7.17)
Both line numbers and code context are not present
To reproduce:
Example initial text:
# This is line 1
# additional line
# This is a line I wish to duplicate
# another additional line
Resulting text in IDLE:
# This is line 1
# This is a line I wish to duplicate
# additional line
# another additional line
Resulting text in Notepad and Notepad++:
# This is line 1
# This is a line I wish to duplicate
# additional line
# This is a line I wish to duplicate
# another additional line
My workaround in IDLE is to add a step between #6 and #7 above, where I mouse click at the desired paste location
terryjreedy commentedon Mar 5, 2020
This is much clearer. To expand on what I said before, inserting *anything*, such as by hitting a key, replaces a selection. I verified that this is normal behavior, at least on Windows, with Notepad, Notepad++, and this Firefox entry box I am typing in. So either of your steps 6 or 7 delete the still selected line, after the goto. (And so a click is needed before 6 to stop the deletion.) I see the continued selection as the problem. Both Notepad and Notepad++ unselect any selection upon goto, the same as if one moved the cursor by clicking instead of goto.
I will try adding text.selection_clear() to the goto code.
[-]IDLE: Copy/Paste behaves like Cut/Paste[/-][+]IDLE: Goto should remove any selection[/+]2 remaining items
terryjreedy commentedon Mar 6, 2020
I am expanding this issue to include the part of bpo-27115 that the PR will fix. (I will also change the scope of the latter).
[-]IDLE: Goto should remove any selection[/-][+]IDLE: Goto should remove selection and update the status bar[/+][-]IDLE: Goto should remove any selection[/-][+]IDLE: Goto should remove selection and update the status bar[/+]DaveLiptack commentedon Mar 6, 2020
Like goto, right-click also exhibits this behavior. Should selection_clear also be added to right-click code?
terryjreedy commentedon Mar 7, 2020
Agreed about right clicks. See new issue bpo-39885.
terryjreedy commentedon Mar 8, 2020
New changeset 2522db1 by Terry Jan Reedy in branch 'master':
bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801)
2522db1
miss-islington commentedon Mar 8, 2020
New changeset a5e821c by Miss Islington (bot) in branch '3.8':
bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801)
a5e821c
miss-islington commentedon Mar 8, 2020
New changeset ec61f53 by Miss Islington (bot) in branch '3.7':
bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801)
ec61f53
gvanrossum commentedon Mar 9, 2020
I have a nit on the commit message used here (and also in bpo-39885). *Please* don't use this style of commit message "IDLE context menu clears selection". That phrasing sounds like it is the description of a bug. Please always use a phrasing that makes it clear what the commit/PR changes. In this case, for example, it could be "IDLE: make context menu clear selection".
I know there are projects that prefer this style. Python is not one of them. Please comply.
terryjreedy commentedon Mar 9, 2020
Is it the temporal ambiguity (fixed by adding 'now', which is in the blurbs) or the descriptive versus command style (as with 'Returns' versus 'Return') that you do not like? If the latter, the devguide could use augmentation.
The only relevant 'guidance' I found is this descriptive example in https://devguide.python.org/pullrequest/#making-good-commits: "the spam module is now more spammy". This seems similar to "IDLE context menu now clears selection". I don't see anything about commit messages in https://devguide.python.org/committing/, which seems like another likely place for such.
gvanrossum commentedon Mar 9, 2020
I guess it's similar to the 'return' vs. 'returns' issue, but I feel much
stronger about it here.
I would have written that as "make the spam module more spammy". Just read
a bunch of commits using e.g.
git log --onelineto see what theprevailing style is.
terryjreedy commentedon Mar 9, 2020
python/devguide#577