Skip to content

Commit 4000143

Browse files
committed
Improve paste
1 parent f52f981 commit 4000143

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib-n-ide/src/main/java/com/duy/ide/editor/view/EditActionSupportEditor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ public boolean doPaste() {
8888

8989
int selectionStart = getSelectionStart();
9090
selectionStart = Math.max(0, selectionStart);
91+
int selectionEnd = getSelectionEnd();
92+
selectionEnd = Math.max(0, selectionEnd);
93+
getText().delete(selectionStart, selectionEnd);
9194
getText().insert(selectionStart, cleanupForPaste(clipboard));
9295
return true;
9396
}

0 commit comments

Comments
 (0)