diff options
| author | Stephen Blott | 2015-06-03 11:23:29 +0100 | 
|---|---|---|
| committer | Stephen Blott | 2015-06-03 11:23:29 +0100 | 
| commit | c567d7d043b689d72eabbd671eab8ae8805dadc1 (patch) | |
| tree | 776cd4fec4a7b2d3f990c01bfa36d12dbf032e50 /background_scripts | |
| parent | a402606774b8fe3bb04203f873804d61944553d6 (diff) | |
| download | vimium-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.coffee | 24 | 
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 | 
