Bug 369104 - [Regression] Selected text is not pasted in search field when search is initiated
Summary: [Regression] Selected text is not pasted in search field when search is initi...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL: https://git.reviewboard.kde.org/r/128...
Keywords:
: 369149 369883 371498 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-09-20 08:12 UTC by Martin Kostolný
Modified: 2016-11-11 20:33 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In: KDE Frameworks 5.27


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Kostolný 2016-09-20 08:12:45 UTC
Since KF 5.26 when I want to search (Ctrl+F) in text editor, I have to copy the selected text, press Ctrl+F and paste the copied text in order to search for it in document.

Reproducible: Always

Steps to Reproduce:
1. Open a text document in any KDE text editor (e.g. Kate)
2. Select a portion of text and press Ctrl+F
3. Select another portion of text and press Ctrl+F

Actual Results:  
Search field is filled by the first portion of text.

Expected Results:  
Search field should be filled by the lastly selected portion of text.

Downgrading to ktexteditor 5.25 fixes this issue.
Comment 1 Christoph Feck 2016-09-26 21:12:54 UTC
*** Bug 369149 has been marked as a duplicate of this bug. ***
Comment 2 c16b7d71 2016-09-27 08:20:47 UTC
Also happens on Gentoo. Downgrading also fixes the problem for me.
Comment 3 Brandner 2016-10-06 11:41:03 UTC
Some additional observations:
- the selection is correctly copied into the text field on the first search
- the selection is correctly copied into the text field when alternating between different modes
of the search bar (e.g., CTRL-F then CTRL-R then again CTRL-F).

The problem appears to be in the method KateNormalInputMode::searchBar. On the first search, the selection is copied into the text field within the constructor of KateSearchBar, which actually invokes KateSearchBar::enterIncrementalMode.

On subsequent searches, the constructor is not called anymore. Consequently,  KateSearchBar::enterIncrementalMode is not invoked unless the mode variable switches between the "power" and "incremental" search modes.

Calling KateSearchBar::enterIncrementalMode within GDB at this moment fixes the problem. So, an obvious fix might be to always invoke KateSearchBar::enterIncrementalMode/ KateSearchBar::enterPowerMode independent from mode changes?
Comment 4 Dominik Haumann 2016-10-06 17:56:12 UTC
I thought this was fixed with KF 5.27, or is it not fixed ?
Comment 5 Christoph Feck 2016-10-07 01:47:27 UTC
*** Bug 369883 has been marked as a duplicate of this bug. ***
Comment 6 Martin Kostolný 2016-10-13 22:19:35 UTC
I cannot replicate it in KF 5.27 -> closing. Thanks for fixing this! :-)
Comment 7 Dominik Haumann 2016-10-23 09:45:04 UTC
*** Bug 371498 has been marked as a duplicate of this bug. ***