Skip to content

Commit

Permalink
highlighter: Prevent unnecessary re-highlighting steps
Browse files Browse the repository at this point in the history
This hint was given within the review process.
  • Loading branch information
JoeKar committed Feb 14, 2024
1 parent a95870d commit 103ed6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/buffer/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (b *SharedBuffer) MarkModified(start, end int) {

if b.Settings["syntax"].(bool) && b.SyntaxDef != nil {
l := start
for i := start; i <= end; i++ {
for i := start; i <= end; i = l + 1 {
l = util.Max(b.Highlighter.ReHighlightStates(b, i), l)
}
b.Highlighter.Highlight(b, start, l)
Expand Down

0 comments on commit 103ed6d

Please sign in to comment.