mirror of
https://github.com/rwinkhart/go-highlite.git
synced 2026-08-30 22:06:27 -04:00
Merge branch 'protect-against-a-case-where-rules-are-nil'
This commit is contained in:
@@ -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