micro/internal/buffer
Dmitry Maluka ffbb257434
Support for highlighting all search matches (hlsearch) (#1762)
* Support for highlighting all search matches (hlsearch)

hlsearch is implemented efficiently using the buffer's line array,
somewhat similarly to the syntax highlighting.
Unlike the syntax highlighter which highlights the entire file,
hlsearch searches for matches for the displayed lines only.
Matches are searched when the given line is displayed first time
or after it was modified. Otherwise the previously found matches
are used.

* Add UnhighlightSearch action

and add it to the list of actions triggered by Esc key by default.

* Add comment explaining the purpose of search map

* Add hlsearch colors to colorschemes

Mostly just copied from the corresponding original (mostly vim) colorschemes.

* Highlight matches during/after replace as well

As a side effect it also changes the last search value, i.e. affects FindNext
and FindPrevious, but it's probably fine. In vim it works the same way.

* Improve hlsearch option description
2021-09-28 13:39:03 -07:00
..
autocomplete.go Fix buffer.RuneAt (#1895) 2020-10-19 20:36:14 -04:00
backup.go Allow aborting while opening a file with backup 2021-08-02 21:05:22 -04:00
buffer.go Support for highlighting all search matches (hlsearch) (#1762) 2021-09-28 13:39:03 -07:00
buffer_generated_test.go Merge branch 'buffer-benchmarks' of https://github.com/p-e-w/micro into p-e-w-buffer-benchmarks 2020-05-20 15:28:36 -04:00
buffer_test.go Use CharacterCount over RuneCount 2020-05-20 16:47:08 -04:00
cursor.go Implement moving cursor up/down within a wrapped line 2021-04-08 23:54:02 +02:00
eventhandler.go Use CharacterCount over RuneCount 2020-05-20 16:47:08 -04:00
line_array.go Support for highlighting all search matches (hlsearch) (#1762) 2021-09-28 13:39:03 -07:00
line_array_test.go Improve unicode line array test 2020-05-20 19:53:54 -04:00
loc.go Use CharacterCount over RuneCount 2020-05-20 16:47:08 -04:00
message.go Warn for readonly instead of setting option 2021-05-19 14:58:00 -04:00
save.go Fix buffer.RuneAt (#1895) 2020-10-19 20:36:14 -04:00
search.go Improve comments 2021-08-21 17:58:30 -04:00
serialize.go Fix quality issues (#1856) 2020-09-16 00:08:01 -04:00
settings.go Support for highlighting all search matches (hlsearch) (#1762) 2021-09-28 13:39:03 -07:00
stack.go Change project layout and use go.mod 2019-12-25 17:05:10 -05:00
stack_test.go Change project layout and use go.mod 2019-12-25 17:05:10 -05:00