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", {
69
69
this . executeCommand ( "cmd_paste" ) ;
70
70
return ;
71
71
}
72
-
72
+
73
73
// clear completion preview so it does not get turned into regular text
74
74
if ( commandline . _completions )
75
75
commandline . _completions . previewClear ( ) ;
76
76
77
77
let elem = liberator . focus ;
78
-
78
+
79
79
if ( elem . setSelectionRange && util . readFromClipboard ( ) ) {
80
80
// readFromClipboard would return 'undefined' if not checked
81
81
// dunno about .setSelectionRange
82
82
// This is a hacky fix - but it works.
83
83
let curTop = elem . scrollTop ;
84
84
let curLeft = elem . scrollLeft ;
85
-
85
+
86
86
let rangeStart = elem . selectionStart ; // caret position
87
87
let rangeEnd = elem . selectionEnd ;
88
88
let tempStr1 = elem . value . substring ( 0 , rangeStart ) ;
@@ -91,7 +91,7 @@ const Editor = Module("editor", {
91
91
elem . value = tempStr1 + tempStr2 + tempStr3 ;
92
92
elem . selectionStart = rangeStart + tempStr2 . length ;
93
93
elem . selectionEnd = elem . selectionStart ;
94
-
94
+
95
95
elem . scrollTop = curTop ;
96
96
elem . scrollLeft = curLeft ;
97
97
}
You can’t perform that action at this time.
0 commit comments