inline hostEditor

GitOrigin-RevId: 17e83d174304d76891ace83593e60a1055b56d31
This commit is contained in:
Max Medvedev
2025-08-25 18:34:06 +00:00
committed by intellij-monorepo-bot
parent 7308e8b570
commit c9d56af5c2
@@ -696,10 +696,9 @@ public class LookupImpl extends LightweightHint implements LookupEx, Disposable,
int prefixLength) {
String lookupString = LookupUtil.getCaseCorrectedLookupString(item, matcher, itemPattern);
final Editor hostEditor = editor;
hostEditor.getCaretModel().runForEachCaret(__ -> {
EditorModificationUtilEx.deleteSelectedText(hostEditor);
final int caretOffset = hostEditor.getCaretModel().getOffset();
editor.getCaretModel().runForEachCaret(__ -> {
EditorModificationUtilEx.deleteSelectedText(editor);
int caretOffset = editor.getCaretModel().getOffset();
LookupElementInsertStopper element = item.as(LookupElementInsertStopper.class);
if (element == null || !element.shouldStopLookupInsertion()) {
int offset;
@@ -713,9 +712,9 @@ public class LookupImpl extends LightweightHint implements LookupEx, Disposable,
LOG.error("When completing " + item + " (" + classes + ")", ae);
return;
}
hostEditor.getCaretModel().moveToOffset(offset);
editor.getCaretModel().moveToOffset(offset);
}
hostEditor.getSelectionModel().removeSelection();
editor.getSelectionModel().removeSelection();
});
editor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE);