Skip to content

Commit 11aaaba

Browse files
committed
Merge pull request #169 from sam113101/master
remove pasteClipboard function
2 parents bd9caf3 + c863e7f commit 11aaaba

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

common/content/editor.js

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -62,36 +62,6 @@ const Editor = Module("editor", {
6262
return text.substring(e.selectionStart, e.selectionEnd);
6363
},
6464

65-
pasteClipboard: function () {
66-
if (liberator.has("Windows")) {
67-
this.executeCommand("cmd_paste");
68-
return;
69-
}
70-
71-
// FIXME: #93 (<s-insert> in the bottom of a long textarea bounces up)
72-
let elem = liberator.focus;
73-
74-
if (elem.setSelectionRange && util.readFromClipboard()) {
75-
// readFromClipboard would return 'undefined' if not checked
76-
// dunno about .setSelectionRange
77-
// This is a hacky fix - but it works.
78-
let curTop = elem.scrollTop;
79-
let curLeft = elem.scrollLeft;
80-
81-
let rangeStart = elem.selectionStart; // caret position
82-
let rangeEnd = elem.selectionEnd;
83-
let tempStr1 = elem.value.substring(0, rangeStart);
84-
let tempStr2 = util.readFromClipboard();
85-
let tempStr3 = elem.value.substring(rangeEnd);
86-
elem.value = tempStr1 + tempStr2 + tempStr3;
87-
elem.selectionStart = rangeStart + tempStr2.length;
88-
elem.selectionEnd = elem.selectionStart;
89-
90-
elem.scrollTop = curTop;
91-
elem.scrollLeft = curLeft;
92-
}
93-
},
94-
9565
// count is optional, defaults to 1
9666
executeCommand: function (cmd, count) {
9767
let controller = Editor.getController(cmd);
@@ -669,10 +639,6 @@ const Editor = Module("editor", {
669639
["<C-End>"], "Move cursor to end of text field",
670640
function () { editor.executeCommand("cmd_moveBottom", 1); });*/
671641

672-
mappings.add(myModes,
673-
["<S-Insert>"], "Insert clipboard/selection",
674-
function () { editor.pasteClipboard(); });
675-
676642
mappings.add(modes.getCharModes("i"),
677643
["<C-i>"], "Edit text field with an external editor",
678644
function () { editor.editFieldExternally(); });

0 commit comments

Comments
 (0)