aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2015-05-12 13:11:44 +0100
committerStephen Blott2015-05-12 13:11:44 +0100
commitea0b6f04e47668e4374c1f3a1eb95e510a5f62b3 (patch)
tree56759f74715eaecceaaad92aadb0ad7842612b56
parent95d3aa2830b4a64c0c30ab682d63f0623ea35a3f (diff)
downloadvimium-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.coffee5
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]