By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.
Bug 1863 - Kate: "use placeholders" should only be enabled when searching using regex
Summary: Kate: "use placeholders" should only be enabled when searching using regex
Status: RESOLVED FIXED
Alias: None
Product: TDE
Classification: Unclassified
Component: tdebase (show other bugs)
Version: R14.0.0 [Trinity]
Hardware: All Linux
: P5 normal
Assignee: Michele Calgaro
URL:
Depends on:
Blocks: 2014
  Show dependency treegraph
 
Reported: 2014-01-24 04:19 CST by Michele Calgaro
Modified: 2014-03-13 01:54 CDT (History)
3 users (show)

See Also:
Compiler Version:
TDE Version String:
Application Version:
Application Name:


Attachments
tdelibs/tdeutils placeholder patch (2.75 KB, patch)
2014-02-11 04:10 CST, Michele Calgaro
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michele Calgaro 2014-01-24 04:19:33 CST
In Kate's replace text dialog, the option "use placeholders" only makes sense when the search string is a regular expression. If the option "regular expression" is not checked, "use placeholders" should not be available (i.e. should be grayed out).
Comment 1 Michele Calgaro 2014-02-11 04:10:44 CST
Created attachment 1927 [details]
tdelibs/tdeutils placeholder patch

The issue is actually in the KFindDialog in tdelibs/tdeutils, so it affects not only Kate but any application that uses the KFindDialog/KReplaceDialog.
Attached is a proposed patch.
Comment 2 Michele Calgaro 2014-02-11 04:11:50 CST
Ah, I forgot to mention that since I am updating Kate's handbook, I will report the change in GUI interaction directly in those updates.
Comment 3 Darrell 2014-02-11 13:13:56 CST
How do I test the patch?

I don't know what placeholders are.

If the patch affects KFindDialog, then what should be tested in other apps?
Comment 4 Michele Calgaro 2014-02-11 19:36:06 CST
> How do I test the patch?
1) Open Kate
2) Open the Replace dialog (should be Ctrl+R)
3) notice "Use placeholders" and the button on its right should be disabled if the "regular expression" checkbox is unchecked
4) toggle the "regular expression" checkbox. "Use placeholders" will be enabled/disabled accordingly
5) the button on the right of "Use placeholders" should be enabled only if both "regular expression" and "Use placeholders" are checked
6) experiment with replacing text with different options set and reopening the dialog, so that each time it opens with different initial settings. Make sure the behavior above is always satistied.

By the way, placeholders are a way to refer to selected text when using regular expressions.
Ex: searching for a(.*)b(.*)c using regular expressions, \1 refers to whatever was matched by the first parenthesis group, \2 refers to the second group and \0 refers to the whole search match.
So searching for a(.*)b(.*)c and replacing with \\1\2 using placeholders, will get rid of the stray a,b and c in the original text.
Comment 5 Michele Calgaro 2014-02-17 23:38:52 CST
(In reply to comment #3)
> then what should be tested in other apps?
You can test in other applications in the same way.
Fro example you can test in KWrite or in TDevelop
Comment 6 Michele Calgaro 2014-03-08 23:18:12 CST
I have been using this patch for 4 weeks without any problem.
Pushed to GIT in commit 81515b6