diff options
author | Micha Gorelick <mynameisfiber@gmail.com> | 2015-03-08 13:05:22 -0400 |
---|---|---|
committer | Daniel Carl <danielcarl@gmx.de> | 2015-03-08 21:28:28 +0100 |
commit | 45388cdf221c54fb797aa8ef9a3db1712523dcac (patch) | |
tree | 70ae9d54f2726a010e7c848f01ec5d89df8f217d /src | |
parent | 3b0f045d0af1eb96e5fea747cea3e7a0251e3091 (diff) |
Added hint-follow-last option
Diffstat (limited to 'src')
-rw-r--r-- | src/hints.c | 3 | ||||
-rw-r--r-- | src/hints.js | 7 | ||||
-rw-r--r-- | src/main.h | 26 | ||||
-rw-r--r-- | src/setting.c | 1 |
4 files changed, 20 insertions, 17 deletions
diff --git a/src/hints.c b/src/hints.c index 0249b8c..6a1626d 100644 --- a/src/hints.c +++ b/src/hints.c @@ -162,8 +162,9 @@ void hints_create(const char *input) JSValueMakeBoolean(hints.ctx, hints.gmode), JSValueMakeNumber(hints.ctx, MAXIMUM_HINTS), js_string_to_ref(hints.ctx, GET_CHAR("hintkeys")), + JSValueMakeBoolean(hints.ctx, GET_BOOL("hint-follow-last")) }; - call_hints_function("init", 4, arguments); + call_hints_function("init", 5, arguments); /* if hinting is started there won't be any additional filter given and * we can go out of this function */ diff --git a/src/hints.js b/src/hints.js index c2a0fe8..c7db2ec 100644 --- a/src/hints.js +++ b/src/hints.js @@ -278,7 +278,7 @@ Object.freeze((function(){ } } } - if (fireLast && validHints.length <= 1) { + if (fireLast && config.followLast && validHints.length <= 1) { focusHint(0); return fire(); } @@ -544,7 +544,7 @@ Object.freeze((function(){ /* the api */ return { - init: function init(mode, keepOpen, maxHints, hintKeys) { + init: function init(mode, keepOpen, maxHints, hintKeys, followLast) { var prop, /* holds the xpaths for the different modes */ xpathmap = { @@ -568,7 +568,8 @@ Object.freeze((function(){ /* don't handle form for Y to allow to yank form filed content */ /* instead of switching to input mode */ handleForm: ("eot".indexOf(mode) >= 0), - hintKeys: hintKeys + hintKeys: hintKeys, + followLast: followLast, }; for (prop in xpathmap) { if (prop.indexOf(mode) >= 0) { @@ -325,29 +325,29 @@ typedef struct { int scrollstep; char *download_dir; guint history_max; - guint timeoutlen; /* timeout for ambiguous mappings */ + guint timeoutlen; /* timeout for ambiguous mappings */ gboolean strict_focus; - GHashTable *headers; /* holds user defined header appended to requests */ + GHashTable *headers; /* holds user defined header appended to requests */ #ifdef FEATURE_ARH GSList *autoresponseheader; /* holds user defined list of auto-response-header */ #endif - char *nextpattern; /* regex patter nfor prev link matching */ - char *prevpattern; /* regex patter nfor next link matching */ - char *file; /* path to the custome config file */ - GSList *cmdargs; /* list of commands given by --cmd option */ - char *cafile; /* path to the ca file */ - GTlsDatabase *tls_db; /* tls database */ - float default_zoom; /* default zoomlevel that is applied on zz zoom reset */ + char *nextpattern; /* regex patter nfor prev link matching */ + char *prevpattern; /* regex patter nfor next link matching */ + char *file; /* path to the custome config file */ + GSList *cmdargs; /* list of commands given by --cmd option */ + char *cafile; /* path to the ca file */ + GTlsDatabase *tls_db; /* tls database */ + float default_zoom; /* default zoomlevel that is applied on zz zoom reset */ gboolean kioskmode; - gboolean input_autohide; /* indicates if the inputbox should be hidden if it's empty */ + gboolean input_autohide; /* indicates if the inputbox should be hidden if it's empty */ #ifdef FEATURE_SOCKET - gboolean socket; /* indicates if the socket is used */ + gboolean socket; /* indicates if the socket is used */ #endif #ifdef FEATURE_HSTS - HSTSProvider *hsts_provider; /* the hsts session feature that is added to soup session */ + HSTSProvider *hsts_provider; /* the hsts session feature that is added to soup session */ #endif #ifdef FEATURE_SOUP_CACHE - SoupCache *soup_cache; /* soup caching feature model */ + SoupCache *soup_cache; /* soup caching feature model */ #endif GHashTable *settings; } Config; diff --git a/src/setting.c b/src/setting.c index faa539d..4e8c544 100644 --- a/src/setting.c +++ b/src/setting.c @@ -203,6 +203,7 @@ void setting_init() i = 1000; setting_add("hint-timeout", TYPE_INTEGER, &i, NULL, 0, NULL); setting_add("hintkeys", TYPE_CHAR, &"0123456789", NULL, 0, NULL); + setting_add("hint-follow-last", TYPE_BOOLEAN, &on, NULL, 0, NULL); setting_add("download-path", TYPE_CHAR, &"", internal, 0, &vb.config.download_dir); i = 2000; setting_add("history-max-items", TYPE_INTEGER, &i, internal, 0, &vb.config.history_max); |