Fix regression in KateNormalInputMode
Review Request #128859 - Created Sept. 7, 2016 and submitted
Patch https://quickgit.kde.org/?p=ktexteditor.git&a=commit&h=9223ac51c9453017c9b11718eed858050697cfbd doesn't work 100% correctly:
Replicating this regression:
1. Open search bar in incremental or power mode and if you want to, type in a search pattern
2. Close the search bar, select some other word and open it again in the same mode (!) => search pattern is not set to new word
You can also:
1. like above
2. With open search bar select other word in the document and open again in the same mode => search pattern is not set to new word
In summary: KateNormalInputMode always has to rerun the respective enter methods of KateSearchBar in order to set a newly selected word as the new search pattern.
With this fix it's working again the same way as before the regression.
you are right!
But one thing I think we still need like in my version: no state change (or find word update) on search next/prev, I guess that enum entry and behavior we still need. You don't want F3 changing mode or word.
Fixed, what Christoph said. Hopefully now again like old behaviour. The only thing I find is not best from user perspective is, that if you are in a certain mode and then hit the key combo for the other one, it switches the search pattern. I think it should be more like this: <being in power mode with non empty search pattern> -> hit ctrl+f3 -> <being in incr mode ALWAYS with same search pattern> -> hit ctrl+f3 again -> <potentially update search pattern>.
But this is something, which needs to be changed in the enter methods of KateSearchBar (I'll probably try to change something different there anyway as soon as this regression fix lands).
Revision 2 (+10 -10)
it should work now, but can you keep the enum untouched? The old name indicated: if you have no bar, you get the normal one, else you keep the mode, now what happens if no bar is there is unclear from the enum name. Fix that, than commit it, thanks!