[RDCT] GTW-5899: Delete selected text when IME text is replaced (for IME inlay mode)

GitOrigin-RevId: 00efb16b9a7cfbdbe5b3d57874c0bc95772d8c3d
This commit is contained in:
Vyacheslav Moklev
2023-08-21 12:18:38 +03:00
committed by intellij-monorepo-bot
parent ad742eaf43
commit cf03e94721

View File

@@ -3901,7 +3901,9 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
if (composedTextIndex < text.getEndIndex()) {
String composedString = createComposedString(composedTextIndex, text);
if (myUseInputMethodInlay) {
var offset = getCaretModel().getPrimaryCaret().getOffset();
runUndoTransparent(() -> EditorModificationUtil.deleteSelectedTextForAllCarets(EditorImpl.this));
var offset = getCaretModel().getCurrentCaret().getOffset();
var caret = e.getCaret();
var leftLength = caret != null ? caret.getInsertionIndex() : 0;
if (leftLength > 0) {