From 296ceee3d25ca52847827d53e9835e57be5e84bb Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 24 Sep 2010 10:35:27 -0400 Subject: [PATCH] Don't blow up if the user hasn't yet clicked the content when moving around in caret mode. --- common/content/editor.js | 5 +++++ pentadactyl/TODO | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/common/content/editor.js b/common/content/editor.js index b8235607..4921a0ad 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -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); }, diff --git a/pentadactyl/TODO b/pentadactyl/TODO index 87039fa9..d44da652 100644 --- a/pentadactyl/TODO +++ b/pentadactyl/TODO @@ -25,8 +25,6 @@ BUGS: (recent Mercurial regressions): 9 about:pentadactyl is currently about:undefined -- visual caret mode is broken, requires a manual page focus first anyway or - else it chucks, I haven't investigated --djk - messages is still broken in several ways - needs testing. => :ls | :echomsg "Foobar" doesn't add "Foobar" to the already open MOW. (NOTE: an intentional design decision by MS - Boo!)