'Replace' doesn't replace values

Bug #1263064 reported by goldencut
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
leafpad (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

'Replace' (Ctrl+H) doesn't replace searched strings but adds (attaches) the new replacement strings to the old ones. Specific case: Replace 100 with 50 throughout document, I get 10050 everywhere, but it should be 50s, IMHO.
Lubuntu 13.04, Leafpad Leafpad 0.8.18.1.

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: leafpad 0.8.18.1-3
ProcVersionSignature: Ubuntu 3.8.0-34.49-generic 3.8.13.12
Uname: Linux 3.8.0-34-generic i686
ApportVersion: 2.9.2-0ubuntu8.5
Architecture: i386
Date: Fri Dec 20 12:23:54 2013
InstallationDate: Installed on 2013-08-29 (112 days ago)
InstallationMedia: Lubuntu 13.04 "Raring Ringtail" - Release i386 (20130423.1)
MarkForUpload: True
SourcePackage: leafpad
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
goldencut (goldencut) wrote :
Revision history for this message
Richard Karolyi (ercatec) wrote :

This bug bothered me for quitea while now.
I finally got around to make a patch, see attachment.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "replace.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
goldencut (goldencut) wrote :

Could developers please pick up this patch and incorporate it into the official build so Leafpad could be improved to be fully functional again?

Revision history for this message
Lyn Perrine (walterorlin) wrote :

In both trusty and vivid this seems to be functioning now and the same version is in utopic so all currently supported releases and devlopment releases have it functioning. Raring is currently eol and so please update to a supported release of lubuntu.

Changed in leafpad (Ubuntu):
status: New → Fix Released
Revision history for this message
Richard Karolyi (ercatec) wrote :

Thanks for looking into this, but I think the bug is not actually fixed yet:

I'm on utopic, leafpad version 0.8.18.1-4 and I can still reproduce this bug.

Important note:
The bug does _NOT_ occur when the checkbox "Replace all at once" is selected.

Use the "Replace" window to manually replace some expressions using the "Find and Replace" button (then click "Yes" a lot of times) while the above mentioned checkbox is _UNCHECKED_ and you should run into the bug immediatly.

Revision history for this message
Dave Kokandy (drkokandy) wrote :

Testing on vivid, even without "Replace all at once", I cannot reproduce this bug.

Tested with generated lorem ipsum. Replace "lorem" with "AAAAA" (one at a time) worked as expected.

Tested with a lot (~25 paragraphs) of generated lorem ipsum. Replaced "lorem" with "50" (one at a time) worked as expected.

Saved above test as "lorem.txt" and retested. Replaced "ipsum" with "50" (one at a time) worked as expected.

Tested with text containing nothing but "100" repeated. Replace "100" with "50" (one at a time) worked as expected.

I really can't reproduce this at all, but the last change to leafpad appears to have been back in October 2013, before this bug was even filed, so I don't think I can support the conclusion that it's fixed. Perhaps the underlying problem is in another package?

Revision history for this message
Lyn Perrine (walterorlin) wrote :

I wonder if we might not have everything nesecary to reproduce this bug or there is something not considered when trying to repeat it like maybe character encoding or line endings. I think maybe RIchard Karolyi should maybe upload a file or a similar one not containing important private information where he is able to reproduce this bug.

Revision history for this message
Richard Karolyi (ercatec) wrote :

Hm, I usually just write "this is a test" and try to replace all "t"s with something.

However, if I remember correctly the bug was somehow related to the window manager and/or selection/focus handling.

From what I remember it was caused by the replace-implementation relying on an programmatically set _active selection_ - and some window managers(?) clear the active selection when the confirmation popup appears and gets focused instead of the editor window.

I changed the implementation to not rely on an active selection but instead to remember the match without the use of the selection.

It has been a long time ago I looked into this though.
I might misremember and I'll try to look into this more in detail when I have time.

Thanks a lot Brendan and Dave for having taking the time to test this tough :)

What window managers do you use btw?
I'm on xubuntu and use xfwm4.

Revision history for this message
ԜаӀtеr Ⅼарсһуnѕkі (wxl) wrote :

Maybe it's best while we wait to just call it incomplete until we can confirm.

Changed in leafpad (Ubuntu):
status: Fix Released → Incomplete
Revision history for this message
Dave Kokandy (drkokandy) wrote :

Richard, I tested this with various versions of Lubuntu (openbox window manager) and Ubuntu (compiz).

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for leafpad (Ubuntu) because there has been no activity for 60 days.]

Changed in leafpad (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.