Optimize the memory usage for syntax highlighting

This commit is contained in:
Zachary Yedidia
2017-03-21 12:45:27 -04:00
parent 214adcf611
commit 59bf1a2260
4 changed files with 85 additions and 44 deletions

View File

@@ -65,9 +65,12 @@ func (c *CellView) Draw(buf *Buffer, top, height, left, width int) {
buf.lines[start-1].rehighlight = false
}
buf.highlighter.ReHighlight(buf, start)
buf.highlighter.ReHighlightStates(buf, start)
}
buf.highlighter.HighlightMatches(buf, top, top+height)
messenger.Message(top, top+height)
c.lines = make([][]*Char, 0)
viewLine := 0