Fixes some bugs with search highlights and behaviour, bringing behaviour more in line with Vim.
VIM-1535 - Use same text attributes ("Text search results") and highlight layer (selection - 1) as IntelliJ's own Find feature. This makes search results more visible. Previously, it would add the highlight below e.g. "identifier under caret" and would use the same colours as Highlight Usages, meaning the current search highlight could easily be lost.
Hide IntelliJ's Find results when starting incsearch, and hide IdeaVim search results when starting IntelliJ Find
Add tests for search highlights and incremental search behaviour
Move the current line during incremental search. Original caret location and scroll position is restored if the search is cancelled
Search highlights are reset and redrawn when the ignorecase, smartcase and hlsearch options are modified. Does not redraw if the highlights have been hidden with :nohlsearch
Highlight all find results instead of just first with incsearch and hlsearch enabled
Remove old search highlights when starting to type a new search with incsearch and hlsearch enabled
Highlight first search result if incsearch is disabled, and hlsearch is enabled (as per Vim)
Incremental search correctly strips trailing options, e.g. /Foo/+1
Add incremental search while typing :substitute command (as per Vim). Does not handle :global, :vglobal, :smagic or :snomagic, as these aren't supported by IdeaVim
Fix disabling Vim emulation does not remove search highlights
VIM-1413 - Fix smartcase option being ignored in incremental search.
VIM-128 - Fix :substitute not respecting ignorecase and smartcase options
Fix next/previous search not handling smartcase override for search next word. E.g. * on Editor overrides smartcase. Now n/N will remember if smartcase was overridden.
Only close ex entry on <BS> if there is no text
Treat <Del> at end of ex entry text as <BS>
VIM-1682 - Fix exception when searching backwards
Fix exception when trying to show search highlights for the last \n in the file
This also fixes a bug which would return an incorrect range when searching backwards, and two matches are found on a line, one before and one after the search position. This is due to reusing a reference, rather than making a copy. This was never discovered because we only used the start offset, not the end!