MarkModified marks the buffer as modified for this frame and performs rehighlighting if syntax highlighting is enabled
(start, end int)
| 183 | // MarkModified marks the buffer as modified for this frame |
| 184 | // and performs rehighlighting if syntax highlighting is enabled |
| 185 | func (b *SharedBuffer) MarkModified(start, end int) { |
| 186 | b.ModifiedThisFrame = true |
| 187 | |
| 188 | start = util.Clamp(start, 0, len(b.lines)-1) |
| 189 | end = util.Clamp(end, 0, len(b.lines)-1) |
| 190 | |
| 191 | if b.Settings["syntax"].(bool) && b.SyntaxDef != nil { |
| 192 | l := -1 |
| 193 | for i := start; i <= end; i++ { |
| 194 | l = util.Max(b.Highlighter.ReHighlightStates(b, i), l) |
| 195 | } |
| 196 | b.Highlighter.HighlightMatches(b, start, l) |
| 197 | } |
| 198 | |
| 199 | for i := start; i <= end; i++ { |
| 200 | b.LineArray.invalidateSearchMatches(i) |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | // DisableReload disables future reloads of this sharedbuffer |
| 205 | func (b *SharedBuffer) DisableReload() { |
no test coverage detected