File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/vs/editor/contrib/linkedEditing/browser Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -300,8 +300,15 @@ export class LinkedEditingContribution extends Disposable implements IEditorCont
300
300
}
301
301
}
302
302
303
- // Clear existing decorations while we compute new ones
304
- this . clearRanges ( ) ;
303
+ if ( ! this . _currentRequestPosition ?. equals ( position ) ) {
304
+ // Get the current range of the first decoration (reference range)
305
+ const currentRange = this . _currentDecorations . getRange ( 0 ) ;
306
+ // If there is no current range or the current range does not contain the new position, clear the ranges
307
+ if ( ! currentRange ?. containsPosition ( position ) ) {
308
+ // Clear existing decorations while we compute new ones
309
+ this . clearRanges ( ) ;
310
+ }
311
+ }
305
312
306
313
this . _currentRequestPosition = position ;
307
314
this . _currentRequestModelVersion = modelVersionId ;
You can’t perform that action at this time.
0 commit comments