CWM: Do not perform autoscroll if editor was changed by remote client, fix CWM-280

GitOrigin-RevId: eec2448bdf51cacd21738843e514121d38765bac
This commit is contained in:
Evgeniy.Stepanov
2020-06-18 21:48:04 +03:00
committed by intellij-monorepo-bot
parent 2f27fb90c6
commit b030aa407f
@@ -2,6 +2,7 @@
package com.intellij.ui;
import com.intellij.codeWithMe.ClientId;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.AnActionEvent;
@@ -71,6 +72,9 @@ public abstract class AutoScrollFromSourceHandler {
}
private void selectInAlarm(final FileEditor editor) {
// Code WithMe: do not process changes from remote (client) editor switching
if (!ClientId.isCurrentlyUnderLocalId()) return;
if (editor != null && myComponent.isShowing() && isAutoScrollEnabled()) {
myAlarm.cancelAllRequests();
myAlarm.addRequest(() -> selectElementFromEditor(editor), getAlarmDelay(), getModalityState());