We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 17035f6 + 1beac47 commit 39867e9Copy full SHA for 39867e9
Sources/CodeEditSourceEditor/Highlighting/StyledRangeContainer/StyledRangeStore/StyledRangeStore.swift
@@ -73,6 +73,13 @@ final class StyledRangeStore {
73
/// - runs: The runs to insert.
74
/// - range: The range to replace.
75
func set(runs: [Run], for range: Range<Int>) {
76
+ let gutsRange = 0..<_guts.count(in: OffsetMetric())
77
+ if range.clamped(to: gutsRange) != range {
78
+ let upperBound = range.clamped(to: gutsRange).upperBound
79
+ let missingCharacters = range.upperBound - upperBound
80
+ storageUpdated(replacedCharactersIn: upperBound..<upperBound, withCount: missingCharacters)
81
+ }
82
+
83
_guts.replaceSubrange(
84
range,
85
in: OffsetMetric(),
0 commit comments