mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-27 04:53:39 +01:00
Consistent non-sucky i_<C-w> across platforms.
This commit is contained in:
@@ -496,6 +496,13 @@ var Editor = Module("editor", {
|
|||||||
editor.selection.removeAllRanges();
|
editor.selection.removeAllRanges();
|
||||||
editor.selection.addRange(range);
|
editor.selection.addRange(range);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clear(forward, re)
|
||||||
|
function _clear(editor) {
|
||||||
|
updateRange(editor, forward, re, function (range) {});
|
||||||
|
editor.selection.deleteFromDocument();
|
||||||
|
}
|
||||||
|
|
||||||
function move(forward, re)
|
function move(forward, re)
|
||||||
function _move(editor) {
|
function _move(editor) {
|
||||||
updateRange(editor, forward, re, function (range) { range.collapse(!forward); });
|
updateRange(editor, forward, re, function (range) { range.collapse(!forward); });
|
||||||
@@ -599,7 +606,12 @@ var Editor = Module("editor", {
|
|||||||
action, update({ type: "editor" }, params));
|
action, update({ type: "editor" }, params));
|
||||||
|
|
||||||
bind(["<C-w>"], "Delete previous word",
|
bind(["<C-w>"], "Delete previous word",
|
||||||
function () { editor.executeCommand("cmd_deleteWordBackward", 1); });
|
function () {
|
||||||
|
if (DOM(dactyl.focusedElement).isInput)
|
||||||
|
clear(false, /\w/)(Editor.getEditor(null));
|
||||||
|
else
|
||||||
|
editor.executeCommand("cmd_deleteWordBackward", 1);
|
||||||
|
});
|
||||||
|
|
||||||
bind(["<C-u>"], "Delete until beginning of current line",
|
bind(["<C-u>"], "Delete until beginning of current line",
|
||||||
function () {
|
function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user