mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
avoid editor position calculation out of EDT (16826)
This commit is contained in:
+1
-1
@@ -143,7 +143,7 @@ public class CreateLocalVarFromInstanceofAction extends BaseIntentionAction {
|
||||
|
||||
private static boolean atSameLine(final PsiExpression condition, final Editor editor) {
|
||||
int line = editor.getCaretModel().getLogicalPosition().line;
|
||||
return editor.offsetToLogicalPosition(condition.getTextOffset()).line == line;
|
||||
return editor.getDocument().getLineNumber(condition.getTextOffset()) == line;
|
||||
}
|
||||
|
||||
public void invoke(@NotNull final Project project, final Editor editor, final PsiFile file) {
|
||||
|
||||
Reference in New Issue
Block a user