mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-70655 IOOBE at com.intellij.openapi.editor.impl.EditorImpl.a
Caret positions are synced only when the same document is opened at the split now.
This commit is contained in:
@@ -555,8 +555,9 @@ public class EditorWindow {
|
||||
if (!(caretSource instanceof TextEditor)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final int offset = ((TextEditor)caretSource).getEditor().getCaretModel().getOffset();
|
||||
|
||||
final Editor editorFrom = ((TextEditor)caretSource).getEditor();
|
||||
final int offset = editorFrom.getCaretModel().getOffset();
|
||||
if (offset <= 0) {
|
||||
return;
|
||||
}
|
||||
@@ -566,8 +567,10 @@ public class EditorWindow {
|
||||
continue;
|
||||
}
|
||||
final Editor editor = ((TextEditor)fileEditor).getEditor();
|
||||
editor.getCaretModel().moveToOffset(offset);
|
||||
editor.getScrollingModel().scrollToCaret(ScrollType.CENTER);
|
||||
if (editorFrom.getDocument() == editor.getDocument()) {
|
||||
editor.getCaretModel().moveToOffset(offset);
|
||||
editor.getScrollingModel().scrollToCaret(ScrollType.CENTER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user