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: Replace selected not working/consistent with find #57795
Entering the Replace dialog (by ctrl+h or from Edit/Replace... menu) with a selection does not auto-magically have the selected text in the find field.
This is not consistent with the other find functions (ctrl+f: Find...; alt+F3: Find in Files...; ctrl+F3: Find Selection) where the highlighted text automatically entered in the find field.
In 3.2 on Win 7, selected text *is* put in the 'find' field of Replace boxes, just as with Find boxes, just as it should be. So there is something specific either to 2.7 (which is unusual, since the code base in mostly the same, but possible) or to your OS. What are you running Python with?
changed the title [-]Replace selected not working/consistent with find[/-][+]IDLE: Replace selected not working/consistent with find[/+]on Dec 17, 2011
marco commented on Dec 17, 2011
marcomannequin
MannequinAuthor
More actions
Win 7 Pro 32bit.
serwy commented on Dec 17, 2011
serwymannequin
Mannequin
More actions
On Linux using 2.7.1 and 3.2, the Replace dialog does not contain the selected text in the Find field.
The find functionality that copies the selected text was introduced in 868ff0dfabd2 on 2002-11-06. Unfortunately it wasn't added to the Replace Dialog code. The attached patch (against 3.3a0) adds this functionality to Replace Dialog and also removes some non-functional (arguably broken) code.
marco commented on Dec 18, 2011
marcomannequin
MannequinAuthor
More actions
To check on 3.2 I installed a fresh Python 3.2.1.1 on Win7 x86 32bit and it has the same problem.
So this issues is valid on 2.7.2.1 and 3.2.1.1
I --dry-run Roger patch on both 2.7 and 3.2 with no errors or warnings messages and after patching it fixes the issue on both versions.
I am running 3.2.2 on 64-bit Win7Pro, which should not make a difference. So why did ^H work right for me yesterday and not for Marco today.
Retrying with fresh IDLEs I discovered the following: selections do not initially appear in the find part of a Replace box (^H). But after selecting and opening a Find box (^F) with something selected, the same text appears in Replace boxes regardless of the actual selection, even if there is no selection -- until another Find box is opened.
So I was fooled yesterday because I tried ^F first to see what the 'correct' behavior was and then did ^H with the same selection. And I did the same in both Shell and Edit windows. When testing, order matters ;-).
I discovered something else I am not sure is what we want. Clicking Find in a Replace box leaves the box open so one can Find again. Clicking Find in a Find box closes it. So you need ^F and Find to re-search.
marco commented on Dec 18, 2011
marcomannequin
MannequinAuthor
More actions
To follow on Terry thought, I think find dialog box should stay open when 'Find' button is pressed, since there is a 'close' button to close it.
That would also be a more accepted behavior similar to all the other editors I know.
And on silly UI design notes:
The 'close' button should be at the bottom instead of the top (and have a capital C)
ctrl+f 'Find' button should say 'Find Next' like most other editors and also since that is what it does.
marco commented on Dec 19, 2011
marcomannequin
MannequinAuthor
More actions
Thank you Roger
find_keep_open.patch works, but now that brings me to bpo-13630 that I thought was existing, and now this confirms it.
Activity
marco commentedon Dec 12, 2011
Entering the Replace dialog (by ctrl+h or from Edit/Replace... menu) with a selection does not auto-magically have the selected text in the find field.
This is not consistent with the other find functions (ctrl+f: Find...; alt+F3: Find in Files...; ctrl+F3: Find Selection) where the highlighted text automatically entered in the find field.
terryjreedy commentedon Dec 17, 2011
In 3.2 on Win 7, selected text *is* put in the 'find' field of Replace boxes, just as with Find boxes, just as it should be. So there is something specific either to 2.7 (which is unusual, since the code base in mostly the same, but possible) or to your OS. What are you running Python with?
[-]Replace selected not working/consistent with find[/-][+]IDLE: Replace selected not working/consistent with find[/+]marco commentedon Dec 17, 2011
Win 7 Pro 32bit.
serwy commentedon Dec 17, 2011
On Linux using 2.7.1 and 3.2, the Replace dialog does not contain the selected text in the Find field.
The find functionality that copies the selected text was introduced in 868ff0dfabd2 on 2002-11-06. Unfortunately it wasn't added to the Replace Dialog code. The attached patch (against 3.3a0) adds this functionality to Replace Dialog and also removes some non-functional (arguably broken) code.
marco commentedon Dec 18, 2011
To check on 3.2 I installed a fresh Python 3.2.1.1 on Win7 x86 32bit and it has the same problem.
So this issues is valid on 2.7.2.1 and 3.2.1.1
I --dry-run Roger patch on both 2.7 and 3.2 with no errors or warnings messages and after patching it fixes the issue on both versions.
terryjreedy commentedon Dec 18, 2011
I am running 3.2.2 on 64-bit Win7Pro, which should not make a difference. So why did ^H work right for me yesterday and not for Marco today.
Retrying with fresh IDLEs I discovered the following: selections do not initially appear in the find part of a Replace box (^H). But after selecting and opening a Find box (^F) with something selected, the same text appears in Replace boxes regardless of the actual selection, even if there is no selection -- until another Find box is opened.
So I was fooled yesterday because I tried ^F first to see what the 'correct' behavior was and then did ^H with the same selection. And I did the same in both Shell and Edit windows. When testing, order matters ;-).
I discovered something else I am not sure is what we want. Clicking Find in a Replace box leaves the box open so one can Find again. Clicking Find in a Find box closes it. So you need ^F and Find to re-search.
marco commentedon Dec 18, 2011
To follow on Terry thought, I think find dialog box should stay open when 'Find' button is pressed, since there is a 'close' button to close it.
That would also be a more accepted behavior similar to all the other editors I know.
And on silly UI design notes:
The 'close' button should be at the bottom instead of the top (and have a capital C)
ctrl+f 'Find' button should say 'Find Next' like most other editors and also since that is what it does.
marco commentedon Dec 19, 2011
Thank you Roger
find_keep_open.patch works, but now that brings me to bpo-13630 that I thought was existing, and now this confirms it.
ZackerySpytz commentedon Dec 13, 2019
I've created a pull request for this issue. Please take a look.
10 remaining items
[3.11] gh-57795: IDLE: Enter the selected text when opening the "Repl…
[3.12] gh-57795: IDLE: Enter the selected text when opening the "Repl…
pythongh-57795: Add news to idlelib/News3.txt
gh-57795: Add news to idlelib/News3.txt (#113522)
pythongh-57795: Add news to idlelib/News3.txt (pythonGH-113522)
pythongh-57795: Add news to idlelib/News3.txt (pythonGH-113522)
[3.12] gh-57795: Add news to idlelib/News3.txt (GH-113522) (#113523)
[3.11] gh-57795: Add news to idlelib/News3.txt (GH-113522) (#113524)
pythongh-57795: IDLE: Enter the selected text when opening the "Repla…
pythongh-57795: Add news to idlelib/News3.txt (python#113522)
pythongh-57795: IDLE: Enter the selected text when opening the "Repla…
pythongh-57795: Add news to idlelib/News3.txt (python#113522)
pythongh-57795: IDLE: Enter the selected text when opening the "Repla…
pythongh-57795: Add news to idlelib/News3.txt (python#113522)