Fix incremental selection-only search
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.
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