aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Ben Boeckel <MathStuf@gmail.com>2011-10-03 12:54:23 -0400
committerGravatar Brendan Taylor <whateley@gmail.com>2011-11-23 18:37:38 -0700
commit6a79cdb5cd9c4c93d15642816d398bcbe36fd692 (patch)
treea2ca82002db11b5fe22e4c7a8429209db718c1ab
parent688d3f6b5c2e2911e1af8c002507921dfc368596 (diff)
Add absolute scrolling argument
-rw-r--r--README1
-rw-r--r--examples/config/config2
-rw-r--r--src/commands.c1
-rw-r--r--src/uzbl-core.c2
4 files changed, 6 insertions, 0 deletions
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 <Space> = scroll vertical end
+@cbind G<Go To:>_ = scroll vertical %r!
+@cbind vG<Go To:>_ = 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;