From: Daniel Carl Date: Wed, 15 Apr 2020 21:00:59 +0000 (+0200) Subject: Allow to push link url to queue by #610. X-Git-Url: https://git.owens.tech/assets/static/dummy.html/assets/static/dummy.html/git?a=commitdiff_plain;h=866ac2b61218332e1138f6f14bc7cb918042f1f5;p=vimb.git Allow to push link url to queue by #610. --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 300f29c..de6a8f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added * The new env variable `$VIMB_SELECTION` is set to the current selected text whenever a `shellcmd` is run #592. +* Allow to push link url to queue by `` #610. ### Fixed * Fixed ignored last line in config file if this line did not end in newline. ### Removed diff --git a/doc/vimb.1 b/doc/vimb.1 index 1534d4d..d4e8cd9 100644 --- a/doc/vimb.1 +++ b/doc/vimb.1 @@ -171,6 +171,13 @@ Reload the website without using caches. .TP .B CTRL\-C Stop loading the current page. +.TP +.B CTRL-LeftMouse, MiddleMouse +Opens the clicket link into new window. +.TP +.B Shift-LeftMouse +Push the link url under the cursor to the end of the Read It Later queue like +the `:qpush' command. . .SS Motion .TP diff --git a/src/main.c b/src/main.c index 384ff3c..24f48ae 100644 --- a/src/main.c +++ b/src/main.c @@ -1392,9 +1392,21 @@ static void decide_navigation_action(Client *c, WebKitPolicyDecision *dec) webkit_policy_decision_ignore(dec); spawn_new_instance(uri); } else { +#ifdef FEATURE_QUEUE + /* Push link target to queue on Shift-LeftMouse. */ + if (webkit_navigation_action_get_navigation_type(a) == WEBKIT_NAVIGATION_TYPE_LINK_CLICKED + && button == 1 + && mod & GDK_SHIFT_MASK + && strcmp(uri, "about:blank")) { + command_queue(c, &((Arg){.i = COMMAND_QUEUE_PUSH, .s = (char *)uri})); + webkit_policy_decision_ignore(dec); + return; + } +#endif #ifdef FEATURE_AUTOCMD - if (strcmp(uri, "about:blank")) + if (strcmp(uri, "about:blank")) { autocmd_run(c, AU_LOAD_STARTING, uri, NULL); + } #endif webkit_policy_decision_use(dec); }