File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -69,20 +69,20 @@ const Editor = Module("editor", {
6969 this . executeCommand ( "cmd_paste" ) ;
7070 return ;
7171 }
72-
72+
7373 // clear completion preview so it does not get turned into regular text
7474 if ( commandline . _completions )
7575 commandline . _completions . previewClear ( ) ;
7676
7777 let elem = liberator . focus ;
78-
78+
7979 if ( elem . setSelectionRange && util . readFromClipboard ( ) ) {
8080 // readFromClipboard would return 'undefined' if not checked
8181 // dunno about .setSelectionRange
8282 // This is a hacky fix - but it works.
8383 let curTop = elem . scrollTop ;
8484 let curLeft = elem . scrollLeft ;
85-
85+
8686 let rangeStart = elem . selectionStart ; // caret position
8787 let rangeEnd = elem . selectionEnd ;
8888 let tempStr1 = elem . value . substring ( 0 , rangeStart ) ;
@@ -91,7 +91,7 @@ const Editor = Module("editor", {
9191 elem . value = tempStr1 + tempStr2 + tempStr3 ;
9292 elem . selectionStart = rangeStart + tempStr2 . length ;
9393 elem . selectionEnd = elem . selectionStart ;
94-
94+
9595 elem . scrollTop = curTop ;
9696 elem . scrollLeft = curLeft ;
9797 }
You can’t perform that action at this time.
0 commit comments