diff options
-rw-r--r-- | README | 3 | ||||
-rw-r--r-- | examples/configs/sampleconfig | 2 | ||||
-rw-r--r-- | examples/configs/sampleconfig-dev | 2 | ||||
-rw-r--r-- | uzbl.c | 11 |
4 files changed, 14 insertions, 4 deletions
@@ -161,7 +161,8 @@ actions follows: * `exit` * `search <string>` * `search_reverse <string>` -* `toggle_insert_mode` +* `toggle_insert_mode <optional state>` + - if the optional state is 0, disable insert mode. If 1, enable insert mode. * `runcmd` - can be used for running a command such as SET or BIND diff --git a/examples/configs/sampleconfig b/examples/configs/sampleconfig index 3cca85c..bca4314 100644 --- a/examples/configs/sampleconfig +++ b/examples/configs/sampleconfig @@ -77,7 +77,7 @@ bind o _ = uri %s bind :wiki _ = uri http://wiki.archlinux.org/index.php/Special:Search?search=%s&go=Go bind gg _ = uri http://www.google.com/search?q=%s bind i = toggle_insert_mode -#TODO: no 'toggle' command? +bind I = toggle_insert_mode 0 # disable insert mode (1 to enable) bind B = spawn /usr/share/uzbl/examples/scripts/insert_bookmark.sh bind U = spawn /usr/share/uzbl/examples/scripts/load_url_from_history.sh bind u = spawn /usr/share/uzbl/examples/scripts/load_url_from_bookmarks.sh diff --git a/examples/configs/sampleconfig-dev b/examples/configs/sampleconfig-dev index de60187..ba916cc 100644 --- a/examples/configs/sampleconfig-dev +++ b/examples/configs/sampleconfig-dev @@ -78,7 +78,7 @@ bind o _ = uri %s bind :wiki _ = uri http://wiki.archlinux.org/index.php/Special:Search?search=%s&go=Go bind gg _ = uri http://www.google.com/search?q=%s bind i = toggle_insert_mode -#TODO: no 'toggle' command? +bind I = toggle_insert_mode 0 # disable insert mode (1 to enable) bind B = spawn ./examples/scripts/insert_bookmark.sh bind U = spawn ./examples/scripts/load_url_from_history.sh bind u = spawn ./examples/scripts/load_url_from_bookmarks.sh @@ -461,7 +461,16 @@ toggle_insert_mode(WebKitWebView *page, const gchar *param) { (void)page; (void)param; - uzbl.behave.insert_mode = ! uzbl.behave.insert_mode; + if (param != NULL) { + if (strcmp (param, "0") == 0) { + uzbl.behave.insert_mode = FALSE; + } else { + uzbl.behave.insert_mode = TRUE; + } + } else { + uzbl.behave.insert_mode = ! uzbl.behave.insert_mode; + } + update_title(); } |