From 6720f4c5a511e5e7b39e6a59e989353f7fb09792 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Wed, 3 Jun 2015 18:57:39 +0100 Subject: Add mark commands to README, simple refactoring. --- content_scripts/marks.coffee | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/marks.coffee b/content_scripts/marks.coffee index 9c6b1458..73c019da 100644 --- a/content_scripts/marks.coffee +++ b/content_scripts/marks.coffee @@ -31,19 +31,17 @@ Marks = # If is depressed, then it's a global mark, otherwise it's a local mark. This is consistent # vim's [A-Z] for global marks, [a-z] for local marks. However, it also admits other non-Latin # characters. - if event.shiftKey - @exit => - chrome.runtime.sendMessage - handler: 'createMark' - markName: keyChar - scrollX: window.scrollX - scrollY: window.scrollY - , => @showMessage "Created global mark", keyChar - else - @exit => - markString = JSON.stringify scrollX: window.scrollX, scrollY: window.scrollY - localStorage[@getLocationKey keyChar] = @getMarkString() - @showMessage "Created local mark", keyChar + @exit => + if event.shiftKey + chrome.runtime.sendMessage + handler: 'createMark' + markName: keyChar + scrollX: window.scrollX + scrollY: window.scrollY + , => @showMessage "Created global mark", keyChar + else + localStorage[@getLocationKey keyChar] = @getMarkString() + @showMessage "Created local mark", keyChar activateGotoMode: (registryEntry) -> # We pick off the last character of the key sequence used to launch this command. Usually this is just "`". -- cgit v1.2.3