diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-10-05 01:13:30 -0400 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-10-05 01:13:30 -0400 |
commit | 4722c8011e046663afcb40376c94632bcbc7157b (patch) | |
tree | 52b521c32915be4692b508d5daeb75ba4cab1778 /common/content | |
parent | 9829b5e0591db7e30afe3dc7b7b65a491c00193a (diff) | |
download | pentadactyl-4722c8011e046663afcb40376c94632bcbc7157b.tar.gz |
Add v_o.
Diffstat (limited to 'common/content')
-rw-r--r-- | common/content/editor.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/common/content/editor.js b/common/content/editor.js index 87274cee..6a28e3c4 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -457,7 +457,7 @@ var Editor = Module("editor", { while (idx == 0 && (node = iterator.getPrev())) { let str = node.textContent; if (node == iterator.start) - idx = range.endOffset; + idx = range.startOffset; else idx = str.length; @@ -906,6 +906,19 @@ var Editor = Module("editor", { modes.push(modes.INSERT); }); + mappings.add([modes.VISUAL], + ["o"], "Focus the other end of the selection", + function () { + if (editor.isTextEdit) + var selection = editor.selection; + else + selection = buffer.focusedFrame.getSelection(); + util.assert(selection.focusOffset); + let { focusOffset, anchorOffset, focusNode, anchorNode } = selection; + selection.collapse(focusNode, focusOffset); + selection.extend(anchorNode, anchorOffset); + }); + bind(["p"], "Paste clipboard contents", function ({ count }) { dactyl.assert(!editor.isCaret); |