Skip to content

Commit 103ed6d

Browse files
committed
highlighter: Prevent unnecessary re-highlighting steps
This hint was given within the review process.
1 parent a95870d commit 103ed6d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/buffer/buffer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func (b *SharedBuffer) MarkModified(start, end int) {
151151

152152
if b.Settings["syntax"].(bool) && b.SyntaxDef != nil {
153153
l := start
154-
for i := start; i <= end; i++ {
154+
for i := start; i <= end; i = l + 1 {
155155
l = util.Max(b.Highlighter.ReHighlightStates(b, i), l)
156156
}
157157
b.Highlighter.Highlight(b, start, l)

0 commit comments

Comments
 (0)