Merge pull request #131185 from microsoft/hediet/fixes-npe
Don't restore selection from markers when there are no markers
This commit is contained in:
commit
f3d4130f2d
|
@ -331,6 +331,10 @@ export class CursorsController extends Disposable {
|
|||
public onModelContentChanged(eventsCollector: ViewModelEventsCollector, e: ModelRawContentChangedEvent | ModelInjectedTextChangedEvent): void {
|
||||
if (e instanceof ModelInjectedTextChangedEvent) {
|
||||
// If injected texts change, the view positions of all cursors need to be updated.
|
||||
if (this._isHandling) {
|
||||
// The view positions will be updated when handling finishes
|
||||
return;
|
||||
}
|
||||
const selectionsFromMarkers = this._cursors.readSelectionFromMarkers();
|
||||
const newState = CursorState.fromModelSelections(selectionsFromMarkers);
|
||||
|
||||
|
|
Loading…
Reference in a new issue