1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-05 13:14:11 +01:00
This commit is contained in:
Kris Maglione
2011-10-05 01:13:30 -04:00
parent 9829b5e059
commit 4722c8011e
2 changed files with 15 additions and 2 deletions

View File

@@ -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);