1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 03:58:00 +01:00

Don't blow up if the user hasn't yet clicked the content when moving around in caret mode.

This commit is contained in:
Kris Maglione
2010-09-24 10:35:27 -04:00
parent 4b5c0d1f84
commit 296ceee3d2
2 changed files with 5 additions and 2 deletions

View File

@@ -424,6 +424,11 @@ const Editor = Module("editor", {
count = 1;
let controller = buffer.selectionController;
let sel = controller.getSelection(controller.SELECTION_NORMAL);
if (!sel.rangeCount) // Hack.
sel.addRange(RangeFind.endpoint(
RangeFind.nodeRange(tabs.localStore.focusedFrame.document.documentElement),
true));
while (count--)
controller[caretModeMethod](caretModeArg, false);
},