! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
"replace all in selection" doesn't work
Status:
RESOLVED: FIXED
Product:
Mousepad
Component:
General

Comments

Description paolo321 2014-06-29 21:19:02 CEST
In replace window, "replace all in selection" doesn't work, replaces everything in all the document, also outside the selected block of text.
Comment 1 Andre Miranda editbugs 2014-07-08 05:15:44 CEST
Steps to reproduce:
Open mousepad
Type: aaaaaaaaa
Select the central portion of the line: aaa[aaa]aaa
Open the replace window(Ctrl+R)
Fill:
  Search for: a
  Replace with: b
Check "Replace all in: Selection"
Click the button "Replace"

Expected result:
aaabbbaaa

Actual result:
aaabbbbbb
Comment 2 Andre Miranda editbugs 2014-09-17 04:21:29 CEST
Testing against the latest version from git(88bc2de), the problem seems to be almost fixed.

Taking the test scenario from my previous comment, the expect result would be:
aaa[bbb]aaa

But the selection changes to:
aaa[bb]baaa
Comment 3 Theo Linkspfeifer editbugs 2019-04-26 22:32:22 CEST
Created attachment 8460 
proposed patch

Changing the gravity of the selection end mark from left (TRUE) to right (FALSE) seems to fix the bug.

https://developer.gnome.org/gtk3/stable/GtkTextBuffer.html#gtk-text-buffer-create-mark
Comment 4 Andre Miranda editbugs 2019-04-29 18:28:48 CEST
Looks good to me, thanks.
Comment 5 Git Bot editbugs 2019-04-29 21:45:59 CEST
Theo Linkspfeifer referenced this bugreport in commit 44e798c432058d76c943e05acee08dd2afec6f3b

Fix gravity of selection end mark (Bug #10986)

https://git.xfce.org/apps/mousepad/commit?id=44e798c432058d76c943e05acee08dd2afec6f3b

Bug #10986

Reported by:
paolo321
Reported on: 2014-06-29
Last modified on: 2019-04-29

People

Assignee:
Matthew Brush
CC List:
3 users

Version

Target Milestone:
Mousepad 0.4.x

Attachments

proposed patch (1015 bytes, patch)
2019-04-26 22:32 CEST , Theo Linkspfeifer
no flags

Additional information