Skip to content

Commit f9cd1ef

Browse files
benoit-pierretimss
authored andcommitted
fix command line Shift+Insert paste on Linux
Clear the completion preview before pasting, otherwise it gets converted to regular input. Additionally, update the completion preview after paste so the behavior is similar to pasting with Ctrl+v or the mouse.
1 parent f1d5ee0 commit f9cd1ef

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

common/content/editor.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ const Editor = Module("editor", {
7070
return;
7171
}
7272

73+
// clear completion preview so it does not get turned into regular text
74+
if (commandline._completions)
75+
commandline._completions.previewClear();
76+
7377
let elem = liberator.focus;
7478

7579
if (elem.setSelectionRange && util.readFromClipboard()) {
@@ -91,6 +95,10 @@ const Editor = Module("editor", {
9195
elem.scrollTop = curTop;
9296
elem.scrollLeft = curLeft;
9397
}
98+
99+
// update completion preview as would happen with Ctrl+v or mouse paste
100+
if (commandline._completions && options.autocomplete)
101+
commandline._completions.complete(true, false);
94102
},
95103

96104
// count is optional, defaults to 1

0 commit comments

Comments
 (0)