Fixed cursor position on cut
This commit is contained in:
parent
8997b0940e
commit
642a0a0078
@ -90,7 +90,8 @@ function cledit(contentElt, scrollEltOpt, isMarkdown = false) {
|
|||||||
function replace(selectionStart, selectionEnd, replacement) {
|
function replace(selectionStart, selectionEnd, replacement) {
|
||||||
undoMgr.setDefaultMode('single');
|
undoMgr.setDefaultMode('single');
|
||||||
replaceContent(selectionStart, selectionEnd, replacement);
|
replaceContent(selectionStart, selectionEnd, replacement);
|
||||||
const endOffset = selectionStart + replacement.length;
|
const startOffset = Math.min(selectionStart, selectionEnd);
|
||||||
|
const endOffset = startOffset + replacement.length;
|
||||||
selectionMgr.setSelectionStartEnd(endOffset, endOffset);
|
selectionMgr.setSelectionStartEnd(endOffset, endOffset);
|
||||||
selectionMgr.updateCursorCoordinates(true);
|
selectionMgr.updateCursorCoordinates(true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user