From 6a79cdb5cd9c4c93d15642816d398bcbe36fd692 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 3 Oct 2011 12:54:23 -0400 Subject: Add absolute scrolling argument --- README | 1 + examples/config/config | 2 ++ src/commands.c | 1 + src/uzbl-core.c | 2 ++ 4 files changed, 6 insertions(+) diff --git a/README b/README index 925392c..2dccafd 100644 --- a/README +++ b/README @@ -141,6 +141,7 @@ The following commands are recognized: - argument can be `begin`, `end`, or an amount given in pixels(?) or as a percentage of the size of the view - set the amount to 100% to scroll a whole page + - argument can be appended with a `!` to scroll absolutely * `reload` - Reload the current page. * `reload_ign_cache` diff --git a/examples/config/config b/examples/config/config index e061e12..dab0c27 100644 --- a/examples/config/config +++ b/examples/config/config @@ -238,6 +238,8 @@ set ebind = @mode_bind global,-insert @cbind ^ = scroll horizontal begin @cbind $ = scroll horizontal end @cbind = scroll vertical end +@cbind G_ = scroll vertical %r! +@cbind vG_ = scroll horizontal %r! # Navigation binds @cbind b = back diff --git a/src/commands.c b/src/commands.c index ff3b15f..8896250 100644 --- a/src/commands.c +++ b/src/commands.c @@ -116,6 +116,7 @@ toggle_status (WebKitWebView* page, GArray *argv, GString *result) { * scroll vertical 20 * scroll vertical 20% * scroll vertical -40 + * scroll vertical 20! * scroll vertical begin * scroll vertical end * scroll horizontal 10 diff --git a/src/uzbl-core.c b/src/uzbl-core.c index c3bc2dd..e869162 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -331,6 +331,8 @@ scroll(GtkAdjustment* bar, gchar *amount_str) { if (*end == '%') value += page_size * amount * 0.01; + else if (*end == '!') + value = amount; else value += amount; -- cgit v1.2.3