about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJosh Rickmar <jrick@devio.us>2012-03-28 16:56:34 -0400
committerJosh Rickmar <jrick@devio.us>2012-05-04 20:41:22 -0400
commitbefa735d97d8f66fb7a0db9f16df5db68d64d743 (patch)
treea55630a01aac47e0f4144b8ee50fd00cd1fd6437
parentf976f776e5a00150a0b572bb5125c206c1b731e8 (diff)
downloadxombrero-befa735d97d8f66fb7a0db9f16df5db68d64d743.tar.gz
Make using :set enable_autoscroll = 1 actually work at runtime by
iterating over each tab and running the autoscroll js.  Dynamically
Setting it to 0 doesn't work here because the js is still running.
Need to find some way to kill it.
-rw-r--r--settings.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/settings.c b/settings.c
index ab3378a..3867f52 100644
--- a/settings.c
+++ b/settings.c
@@ -1080,8 +1080,17 @@ set_auto_load_images(char *value)
 int
 set_enable_autoscroll(char *value)
 {
-	enable_autoscroll = atoi(value);
-	return (0);
+        struct tab              *t;
+ 
+        enable_autoscroll = atoi(value);
+        if (enable_autoscroll) {
+                TAILQ_FOREACH(t, &tabs, entry) {
+                        run_script(t, JS_AUTOSCROLL);
+                }
+        } else {
+		/* XXX: kill the script */
+	}
+        return (0);
 }
 
 int