Skip to content

gh-71956: Fix IDLE Replace All searching up without wrap around#152737

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-71956-replace-all-up
Open

gh-71956: Fix IDLE Replace All searching up without wrap around#152737
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-71956-replace-all-up

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 1, 2026

Copy link
Copy Markdown
Member

In the editor's Replace dialog, Replace All with the search direction set to "Up" and "Wrap around" off replaced only the first match above the current position (and, wrongly, all matches below it).

It searched backwards for the first match, then replaced forwards from there to the end of the text. Now, for a backward search without wrap, it replaces top-to-bottom from the start of the text down to the first match at or above the current position — consistently with the "Up" direction. A mark tracks that stop point across the edits.

Minimal reproducer (| is the cursor):

a
a|
a

Search a, replace with b, direction "Up", "Wrap around" off, Replace All.
Before: a / b / b. After: b / b / a.

Tests now cover all four direction/wrap-around combinations.

🤖 Generated with Claude Code

When the search direction is "Up" and "Wrap around" is off, Replace All
replaced only the first match above the current position (and all matches
below it).  It now replaces all matches from the start of the text down to
the current position, consistently with the "Up" direction.
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant