@@ -129,15 +129,7 @@ export class FullFileRenderStrategy extends ViewEventHandler implements IGpuRend
129
129
// TODO: This currently invalidates everything after the deleted line, it could shift the
130
130
// line data up to retain some up to date lines
131
131
// TODO: This does not invalidate lines that are no longer in the file
132
- for ( const i of [ 0 , 1 ] ) {
133
- const upToDateLines = this . _upToDateLines [ i ] ;
134
- const lines = Array . from ( upToDateLines ) ;
135
- for ( const upToDateLine of lines ) {
136
- if ( upToDateLine > e . fromLineNumber ) {
137
- upToDateLines . delete ( upToDateLine ) ;
138
- }
139
- }
140
- }
132
+ this . _invalidateLinesFrom ( e . fromLineNumber ) ;
141
133
142
134
// Queue updates that need to happen on the active buffer, not just the cache. This is
143
135
// deferred since the active buffer could be locked by the GPU which would block the main
@@ -150,15 +142,7 @@ export class FullFileRenderStrategy extends ViewEventHandler implements IGpuRend
150
142
public override onLinesInserted ( e : ViewLinesInsertedEvent ) : boolean {
151
143
// TODO: This currently invalidates everything after the deleted line, it could shift the
152
144
// line data up to retain some up to date lines
153
- for ( const i of [ 0 , 1 ] ) {
154
- const upToDateLines = this . _upToDateLines [ i ] ;
155
- const lines = Array . from ( upToDateLines ) ;
156
- for ( const upToDateLine of lines ) {
157
- if ( upToDateLine > e . fromLineNumber ) {
158
- upToDateLines . delete ( upToDateLine ) ;
159
- }
160
- }
161
- }
145
+ this . _invalidateLinesFrom ( e . fromLineNumber ) ;
162
146
return true ;
163
147
}
164
148
@@ -180,6 +164,18 @@ export class FullFileRenderStrategy extends ViewEventHandler implements IGpuRend
180
164
181
165
// #endregion
182
166
167
+ private _invalidateLinesFrom ( lineNumber : number ) : void {
168
+ for ( const i of [ 0 , 1 ] ) {
169
+ const upToDateLines = this . _upToDateLines [ i ] ;
170
+ const lines = Array . from ( upToDateLines ) ;
171
+ for ( const upToDateLine of lines ) {
172
+ if ( upToDateLine >= lineNumber ) {
173
+ upToDateLines . delete ( upToDateLine ) ;
174
+ }
175
+ }
176
+ }
177
+ }
178
+
183
179
reset ( ) {
184
180
for ( const bufferIndex of [ 0 , 1 ] ) {
185
181
// Zero out buffer and upload to GPU to prevent stale rows from rendering
0 commit comments