diff options
| author | Stephen Blott | 2015-05-15 10:46:24 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-15 10:46:24 +0100 |
| commit | 623f770324ae86edd3a8d1817164a79656967ade (patch) | |
| tree | 3ce64a3e164f762831cc0f2be2c2d209e968bdd3 /background_scripts | |
| parent | ff1f7ac546d387a283a7421ba714c0d566d1f006 (diff) | |
| download | vimium-623f770324ae86edd3a8d1817164a79656967ade.tar.bz2 | |
Add comment explaining why we use try/catch.
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/completion.coffee | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 8000c62b..011fbdfb 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -235,13 +235,14 @@ class HistoryCompleter [] onComplete results.map (entry) => # If this history URL starts with the search URL, we reconstruct the original search terms, and insert - # them into the vomnibar when this suggestion is selected. + # them into the vomnibar when this suggestion is selected. We use try/catch because + # decodeURIComponent() throw an error. insertText = - if entry.url.startsWith searchUrl - try + try + if entry.url.startsWith searchUrl entry.url[searchUrl.length..].split(searchUrlTerminator)[0].split("+").map(decodeURIComponent).join " " - catch - null + catch + null new Suggestion queryTerms: queryTerms |
