[Conkeror] [PATCH] Optionally don't accept partial matches as webjumps.
David Kettler
kettler at internode.on.net
Fri Mar 20 19:34:24 PDT 2009
A variable webjump_partial_match (default true) selects whether a
unique prefix is accepted as a webjump. The user may want to set this
false because webjumps can get in the way when using the default
search feature. Webjumps are easy to complete, so partial matches are
not that important.
---
modules/webjump.js | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/modules/webjump.js b/modules/webjump.js
index 7ca9c48..dcc570c 100644
--- a/modules/webjump.js
+++ b/modules/webjump.js
@@ -134,6 +134,11 @@ function define_default_webjumps()
define_webjump("kuro5hin", "http://www.kuro5hin.org/?op=search&string=%s");
}
+define_variable("webjump_partial_match", true,
+ "When entering a url, if the input is not a webjump, " +
+ "but would uniquely complete to a webjump, then accept " +
+ "that webjump only if this is true.");
+
function match_webjump(str) {
var sp = str.indexOf(' ');
@@ -152,7 +157,7 @@ function match_webjump(str) {
var match = webjumps[key];
// Look for a partial match
- if (!match) {
+ if (!match && webjump_partial_match) {
for (let [k,v] in Iterator(webjumps)) {
if (k.substring(0, key.length) == key) {
if (match) {
--
1.6.2
More information about the Conkeror
mailing list