mirror of
https://github.com/rwinkhart/go-highlite.git
synced 2026-10-27 03:49:59 -04:00
Merge branch 'protect-against-a-case-where-rules-are-nil'
This commit is contained in:
commit
5d44bdc87e
1 file changed
+5
@@ -223,6 +223,11 @@ func (h *Highlighter) highlightRegion(highlights LineMatch, start int, canMatchE
|
||||
}
|
||||
|
||||
func (h *Highlighter) highlightEmptyRegion(highlights LineMatch, start int, canMatchEnd bool, lineNum int, line []rune, statesOnly bool) LineMatch {
|
||||
if h.Def.rules == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
if len(line) == 0 {
|
||||
if canMatchEnd {
|
||||
h.lastRegion = nil
|
||||
|
||||
Reference in new issue
Block a user