@codemirror/highlight
Advanced tools
Comparing version 0.19.2 to 0.19.3
@@ -0,1 +1,7 @@ | ||
## 0.19.3 (2021-09-03) | ||
### Bug fixes | ||
Fix a crash in the highlighter when there were multiple visible ranges in the view and the gaps between them overlap with a tree overlay. | ||
## 0.19.2 (2021-08-19) | ||
@@ -2,0 +8,0 @@ |
@@ -460,6 +460,7 @@ import { NodeProp, NodeType } from '@lezer/common'; | ||
let nextPos = next ? next.from + start : end; | ||
if (nextPos > pos && hasChild) { | ||
while (cursor.from < nextPos) { | ||
this.highlightRange(cursor, pos, nextPos, inheritedClass, depth + 1, scope); | ||
this.startSpan(Math.min(to, cursor.to), cls); | ||
let rangeFrom = Math.max(from, pos), rangeTo = Math.min(to, nextPos); | ||
if (rangeFrom < rangeTo && hasChild) { | ||
while (cursor.from < rangeTo) { | ||
this.highlightRange(cursor, rangeFrom, rangeTo, inheritedClass, depth + 1, scope); | ||
this.startSpan(Math.min(to, rangeTo), cls); | ||
if (cursor.to >= nextPos || !cursor.nextSibling()) | ||
@@ -469,7 +470,9 @@ break; | ||
} | ||
if (!next) | ||
if (!next || nextPos > to) | ||
break; | ||
this.highlightRange(inner.cursor, next.from + start, next.to + start, inheritedClass, depth, mounted.tree.type); | ||
pos = next.to + start; | ||
this.startSpan(pos, cls); | ||
if (pos > from) { | ||
this.highlightRange(inner.cursor, Math.max(from, next.from + start), Math.min(to, pos), inheritedClass, depth, mounted.tree.type); | ||
this.startSpan(pos, cls); | ||
} | ||
} | ||
@@ -476,0 +479,0 @@ if (hasChild) |
{ | ||
"name": "@codemirror/highlight", | ||
"version": "0.19.2", | ||
"version": "0.19.3", | ||
"description": "Syntax highlighting for the CodeMirror code editor", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
107024
2601