diff options
| author | Stephen Blott | 2015-05-12 13:11:44 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-12 13:11:44 +0100 |
| commit | ea0b6f04e47668e4374c1f3a1eb95e510a5f62b3 (patch) | |
| tree | 56759f74715eaecceaaad92aadb0ad7842612b56 | |
| parent | 95d3aa2830b4a64c0c30ab682d63f0623ea35a3f (diff) | |
| download | vimium-ea0b6f04e47668e4374c1f3a1eb95e510a5f62b3.tar.bz2 | |
In vomnibar, <Enter> excludes prompted text.
This changes the behaviour of <Enter> in the vomnibar when a prompted
text is present (i.e. text from a suggestion which the user has not yet
typed. Now, that text is no longer included in the query launched with
<Enter>. After a little experience, I'd say that's a pretty bad UX.
This also adds a <Ctrl-Enter> binding to launch the query with the
prompted text included.
| -rw-r--r-- | pages/vomnibar.coffee | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pages/vomnibar.coffee b/pages/vomnibar.coffee index 7c9eef83..6485aed8 100644 --- a/pages/vomnibar.coffee +++ b/pages/vomnibar.coffee @@ -200,7 +200,10 @@ class VomnibarUI # (addPromptedText), the text in the input might not correspond to any of the completions. So we # fire off the query to the background page and use the completion at the top of the list (which # will be the right one). - window.getSelection()?.collapseToEnd() if @inputContainsASelectionRange() + # + # <Enter> on its own selects only the text that the user has typed. <Control-Enter> also includes + # any prompted text. + window.getSelection()?.collapseToEnd() if @inputContainsASelectionRange() and event.ctrlKey @update true, => if @completions[0] completion = @completions[0] |
