File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -312,14 +312,18 @@ class Minimap {
312312 this . pendingChangeEvents = this . pendingChangeEvents . concat ( changes )
313313
314314 // Optimisation: If the redraw delay is set to 0, do not even schedule a timer
315- if ( ! this . redrawDelay ) {
316- return this . flushChanges ( )
315+ if ( ! this . redrawDelay && ! this . requestedFlushChanges ) {
316+ this . requestedFlushChanges = true
317+ requestAnimationFrame ( ( ) => { this . flushChanges ( ) ; this . requestedFlushChanges = false } )
317318 }
318319
319- if ( ! this . flushChangesTimer ) {
320+ if ( ! this . flushChangesTimer && ! this . requestedFlushChanges ) {
320321 // If any changes happened within the timeout's delay, a timeout will already have been
321322 // scheduled -> no need to schedule again
322- this . flushChangesTimer = setTimeout ( ( ) => { this . flushChanges ( ) } , this . redrawDelay )
323+ this . requestedFlushChanges = true
324+ this . flushChangesTimer = setTimeout (
325+ ( ) => { requestAnimationFrame ( ( ) => { this . flushChanges ( ) ; this . requestedFlushChanges = false } ) }
326+ , this . redrawDelay )
323327 }
324328 }
325329
You can’t perform that action at this time.
0 commit comments