Bug 294396

Summary: searchText from KTextEditor::SearchInterface doesn't search correctly for some regexps(possible large ones)
Product: [Applications] kate Reporter: Cosmin Mihai <yonutix.mc>
Component: searchAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: Darren.Lissimore, justin.zobel, loh.tar, shentey, yonutix.mc
Priority: NOR Keywords: testcase
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: mini plugin for SearchInterface bug

Description Cosmin Mihai 2012-02-18 23:08:01 UTC
Version:           unspecified (using KDE 4.8.0) 
OS:                Linux

I search backwards for a regexp in a document within a range, the match returned is always the last match of the document, not the last match of the range.
I have written a mini plugin that marks out the bug.

Reproducible: Always

Steps to Reproduce:
Create the plugin from attached files.
Write a tag in the text field , for example <test>, then write before it another onebefore it.Let's say <test2>.You will have <test2><test>.Then look in Terminal.

Actual Results:  
You can see in the console an incorrect output(A range out of the range given as parameter).


Expected Results:  
A range within the range given as parameter or invalid range.
Comment 1 Cosmin Mihai 2012-02-18 23:10:54 UTC
Created attachment 68914 [details]
mini plugin for SearchInterface bug
Comment 2 Darren Lissimore 2017-09-19 08:22:15 UTC
This actually still appears to be happening in Kate 17.08.1

Is regex searching within a range disabled for some reason? 

Test procedure:
a) Open html file - with lots of <div> tags .
b) Open Find bar - switch to power-search/replace
c) Set Mode to "Regular expression"
d) Enter '[ \t]{0,}(</div>)' in Find box
e) Select a range of the html file - lines X to X+y
   ( ensuring multiple </div> tags are in the selected range)
f) Ensure - "search in selection only" is on;
g) Press enter to find first occurrence - of the tag (should succeed)
h) Press enter again - should advance to next tag  ( Does not succeed)

Removing the "search in selection only" - and the "find next" "find previous" work well. 
With the "search in selection only" - it finds the first occurrence then no more. 

Problem may be in KateSearchBar::find() - and it's checks on regex mode and selection with multi-line matching
Comment 3 Lothar 2019-02-28 19:31:43 UTC
Is that still an issue or solved?
Seems to work here.
Frameworks 5.55.0
Comment 4 Justin Zobel 2020-10-30 04:03:10 UTC
Cosmin as mentioned in Comment 3 can you please confirm if this is still an issue for you.
Comment 5 Bug Janitor Service 2020-11-14 04:33:43 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Bug Janitor Service 2020-11-29 04:33:42 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!