]> git.lizzy.rs Git - micro.git/commit
Fix end line number in HighlightMatches (#1662)
authordmaluka <dmitrymaluka@gmail.com>
Sun, 17 May 2020 20:05:34 +0000 (22:05 +0200)
committerGitHub <noreply@github.com>
Sun, 17 May 2020 20:05:34 +0000 (16:05 -0400)
commita150eef6f900b0bd23b19fbc59308bd267d66cdd
treed3c0b9c6c641fc0f9fbbaf986892a9fdfdc337f4
parent299af4a3dbce5c81a85233ecadf5ea5d81acf588
Fix end line number in HighlightMatches (#1662)

There is a bit of mess in the usage of HighlightMatches: in some places
we assume that it updates lines from startline to endline inclusive,
in other places we assume it's non-inclusive.
This fix makes it always inclusive.

In particular, it fixes a bug: when we open a file which has no
newline at the end, the last line isn't highlighted.
internal/buffer/buffer.go
pkg/highlight/highlighter.go