Skip to content

Fix incremental selection-only search

Jan Paul Batrina requested to merge work/fix-selection-search into master

Since search matches are selected after they are found, the "Search in selection only" option only works the first time.

This patch saves the initial selection where the search is initiated and use that for succeeding selection-only searches. The selection is "forgotten" only after the selection is manually changed or the "selection only" option is toggled.

BUG: 327408

I only added basic tests (to make sure that selection-only searches now move forward/backward and for search wrapping), but I'm not sure if there are other special cases where a test would be needed.

Also I think one possible problem is that users might not notice that they have the "Search in selection only" option (especially since it is automatically enabled when multiple lines are selected) and be surprised that search somehow gets stopped/wrapped abruptly

kate-selection-search

Edited by Jan Paul Batrina

Merge request reports