Share more buffer elements and fix rehighlight

Fixes #1521
This commit is contained in:
Zachary Yedidia
2020-02-19 14:41:30 -05:00
parent 190d9d0609
commit a9120ce270
2 changed files with 82 additions and 88 deletions

View File

@@ -397,21 +397,7 @@ func (w *BufWindow) displayBuffer() {
bufWidth--
}
if len(b.Modifications) > 0 {
if b.Settings["syntax"].(bool) && b.SyntaxDef != nil {
for _, r := range b.Modifications {
rx := util.Clamp(r.X, 0, b.LinesNum())
ry := util.Clamp(r.Y, 0, b.LinesNum())
final := -1
for i := rx; i <= ry; i++ {
final = util.Max(b.Highlighter.ReHighlightStates(b, i), final)
}
b.Highlighter.HighlightMatches(b, rx, final+1)
}
}
b.ClearModifications()
if b.ModifiedThisFrame {
if b.Settings["diffgutter"].(bool) {
b.UpdateDiff(func(synchronous bool) {
// If the diff was updated asynchronously, the outer call to
@@ -426,6 +412,7 @@ func (w *BufWindow) displayBuffer() {
}
})
}
b.ModifiedThisFrame = false
}
var matchingBraces []buffer.Loc