Skip to content

Commit 3f8ecf0

Browse files
committed
Update filebrowser.js
1 parent e713d45 commit 3f8ecf0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

filebrowser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,13 +2443,13 @@ function setupEditor() {
24432443
// replace selection contents
24442444
// with beautified text
24452445
cd.deleteCurrentSelection();
2446-
cd.insert(beautifiedText);
2446+
cd.insert(beautifiedText, { moveToEnd: false });
24472447

24482448
// get caret pos in text
24492449
const pos = cd.getSelection();
24502450

24512451
// select beautified text
2452-
cd.setSelection((pos.start - beautifiedText.length), pos.start);
2452+
cd.setSelection(pos.start, (pos.start + beautifiedText.length));
24532453

24542454
// dispatch type event (simulate typing)
24552455
cd.dispatchTypeEvent();

0 commit comments

Comments
 (0)