Properly clear syntax highlighting when it is disabled

This commit is contained in:
Zachary Yedidia
2017-03-20 17:40:33 -04:00
parent 23152f0c50
commit 214adcf611
2 changed files with 16 additions and 0 deletions

View File

@@ -467,3 +467,11 @@ func (b *Buffer) MoveLinesDown(start int, end int) {
Loc{0, end + 1},
)
}
// ClearMatches clears all of the syntax highlighting for this buffer
func (b *Buffer) ClearMatches() {
for i := range b.lines {
b.SetMatch(i, nil)
b.SetState(i, nil)
}
}