Skip to content

Fix wgrep footer marking excluding last result from edits - #199

Open
fabianfranzelin wants to merge 1 commit into
dajva:masterfrom
fabianfranzelin:master
Open

fabianfranzelin wants to merge 1 commit into
dajva:masterfrom
fabianfranzelin:master

Conversation

@fabianfranzelin

Copy link
Copy Markdown

The previous code used (forward-line -1) after finding the 'rg finished' line, which moved point to the last result line and marked it as read-only footer. This caused wgrep to skip the last match during search-replace operations.

Fix by using (beginning-of-line) on the 'rg finished' line itself, so only that line and anything after it is marked as footer.

The previous code used (forward-line -1) after finding the 'rg finished'
line, which moved point to the last result line and marked it as
read-only footer. This caused wgrep to skip the last match during
search-replace operations.

Fix by using (beginning-of-line) on the 'rg finished' line itself,
so only that line and anything after it is marked as footer.
@dajva

dajva commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Thanks for the pr!
This makes all wgrep tests fail. Not sure why I can't trigger gh actions on this pr but you can run it yourself locally: https://rgel.readthedocs.io/en/latest/contribute.html

7 unexpected results:
   FAILED  rg-integration-test/wgrep-group
   FAILED  rg-integration-test/wgrep-group-align
   FAILED  rg-integration-test/wgrep-group-align-columns
   FAILED  rg-integration-test/wgrep-group-align-columns-custom-separators
   FAILED  rg-integration-test/wgrep-group-columns
   FAILED  rg-integration-test/wgrep-nogroup
   FAILED  rg-integration-test/wgrep-nogroup-columns

So not sure what environment you are running or if you triggered some edge case or something. As it stands now, I can't merge this as is. If you can provide more info on how this happens, ideally a self contained test case that shows this in a clean environment I can take a more thorough look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants