aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2015-06-03 11:23:29 +0100
committerStephen Blott2015-06-03 11:23:29 +0100
commitc567d7d043b689d72eabbd671eab8ae8805dadc1 (patch)
tree776cd4fec4a7b2d3f990c01bfa36d12dbf032e50 /background_scripts
parenta402606774b8fe3bb04203f873804d61944553d6 (diff)
downloadvimium-c567d7d043b689d72eabbd671eab8ae8805dadc1.tar.bz2
Fix marks (incl. global marks)...
Fixes #1712: - Make global marks work. - Add mode indicator. - Don't fail for global marks on background page if mark is not set. - Give HUD warning for global marks if global mark is not set. (The diff is big but, which the exception of infrastructure refactoring, the main change is to not exit on <Shift>, thereby fixing #1712).
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/marks.coffee24
1 files changed, 15 insertions, 9 deletions
diff --git a/background_scripts/marks.coffee b/background_scripts/marks.coffee
index 15d41205..db9c4ae2 100644
--- a/background_scripts/marks.coffee
+++ b/background_scripts/marks.coffee
@@ -23,12 +23,18 @@ removeMarksForTab = (id) ->
root.goto = (req, sender) ->
mark = marks[req.markName]
- chrome.tabs.update mark.tabId, selected: true
- chrome.tabs.sendMessage mark.tabId,
- name: "setScrollPosition"
- scrollX: mark.scrollX
- scrollY: mark.scrollY
- chrome.tabs.sendMessage mark.tabId,
- name: "showHUDforDuration",
- text: "Jumped to global mark '#{req.markName}'"
- duration: 1000
+ if mark?
+ chrome.tabs.update mark.tabId, selected: true
+ chrome.tabs.sendMessage mark.tabId,
+ name: "setScrollPosition"
+ scrollX: mark.scrollX
+ scrollY: mark.scrollY
+ chrome.tabs.sendMessage mark.tabId,
+ name: "showHUDforDuration",
+ text: "Jumped to global mark '#{req.markName}'."
+ duration: 1000
+ else
+ chrome.tabs.sendMessage sender.tab.id,
+ name: "showHUDforDuration",
+ text: "Global mark not set: '#{req.markName}'."
+ duration: 1000