Changed insert_mode into toggle_insert_mode.
authorBarrucadu <mike@barrucadu.co.uk>
Sun, 17 May 2009 21:29:17 +0000 (22:29 +0100)
committerBarrucadu <mike@barrucadu.co.uk>
Sun, 17 May 2009 21:29:17 +0000 (22:29 +0100)
README
examples/configs/sampleconfig
examples/configs/sampleconfig-dev
uzbl.c
uzbl.h

diff --git a/README b/README
index e170e67..bdfb403 100644 (file)
--- a/README
+++ b/README
@@ -161,7 +161,7 @@ actions follows:
 * `exit`
 * `search <string>`
 * `search_reverse <string>`
-* `insert_mode`
+* `toggle_insert_mode`
 * `runcmd`
    - can be used for running a command such as SET or BIND
 
index ada1134..3cca85c 100644 (file)
@@ -76,7 +76,7 @@ bind    gh        = uri http://www.uzbl.org
 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         = insert_mode
+bind    i         = toggle_insert_mode
 #TODO: no 'toggle' command?
 bind    B         = spawn /usr/share/uzbl/examples/scripts/insert_bookmark.sh
 bind    U         = spawn /usr/share/uzbl/examples/scripts/load_url_from_history.sh
index 337da7b..de60187 100644 (file)
@@ -77,7 +77,7 @@ bind    gh        = uri http://www.uzbl.org
 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         = insert_mode
+bind    i         = toggle_insert_mode
 #TODO: no 'toggle' command?
 bind    B         = spawn ./examples/scripts/insert_bookmark.sh
 bind    U         = spawn ./examples/scripts/load_url_from_history.sh
diff --git a/uzbl.c b/uzbl.c
index 1b8e8bc..2c3f8b3 100644 (file)
--- a/uzbl.c
+++ b/uzbl.c
@@ -394,27 +394,27 @@ VIEWFUNC(go_forward)
 
 static struct {char *name; Command command;} cmdlist[] =
 {
-    { "back",             view_go_back            },
-    { "forward",          view_go_forward         },
-    { "scroll_vert",      scroll_vert             },
-    { "scroll_horz",      scroll_horz             },
-    { "scroll_begin",     scroll_begin            },
-    { "scroll_end",       scroll_end              },
-    { "reload",           view_reload,            },
-    { "reload_ign_cache", view_reload_bypass_cache},
-    { "stop",             view_stop_loading,      },
-    { "zoom_in",          view_zoom_in,           }, //Can crash (when max zoom reached?).
-    { "zoom_out",         view_zoom_out,          },
-    { "uri",              load_uri                },
-    { "script",           run_js                  },
-    { "toggle_status",    toggle_status_cb        },
-    { "spawn",            spawn                   },
-    { "sh",               spawn_sh                },
-    { "exit",             close_uzbl              },
-    { "search",           search_forward_text     },
-    { "search_reverse",   search_reverse_text     },
-    { "insert_mode",      set_insert_mode         },
-    { "runcmd",           runcmd                  }
+    { "back",               view_go_back            },
+    { "forward",            view_go_forward         },
+    { "scroll_vert",        scroll_vert             },
+    { "scroll_horz",        scroll_horz             },
+    { "scroll_begin",       scroll_begin            },
+    { "scroll_end",         scroll_end              },
+    { "reload",             view_reload,            },
+    { "reload_ign_cache",   view_reload_bypass_cache},
+    { "stop",               view_stop_loading,      },
+    { "zoom_in",            view_zoom_in,           }, //Can crash (when max zoom reached?).
+    { "zoom_out",           view_zoom_out,          },
+    { "uri",                load_uri                },
+    { "script",             run_js                  },
+    { "toggle_status",      toggle_status_cb        },
+    { "spawn",              spawn                   },
+    { "sh",                 spawn_sh                },
+    { "exit",               close_uzbl              },
+    { "search",             search_forward_text     },
+    { "search_reverse",     search_reverse_text     },
+    { "toggle_insert_mode", toggle_insert_mode      },
+    { "runcmd",             runcmd                  }
 };
 
 static void
@@ -457,11 +457,11 @@ file_exists (const char * filename) {
 }
 
 void
-set_insert_mode(WebKitWebView *page, const gchar *param) {
+toggle_insert_mode(WebKitWebView *page, const gchar *param) {
     (void)page;
     (void)param;
 
-    uzbl.behave.insert_mode = TRUE;
+    uzbl.behave.insert_mode = ! uzbl.behave.insert_mode;
     update_title();
 }
 
diff --git a/uzbl.h b/uzbl.h
index 49a275d..251d270 100644 (file)
--- a/uzbl.h
+++ b/uzbl.h
@@ -258,7 +258,7 @@ static bool
 file_exists (const char * filename);
 
 void
-set_insert_mode(WebKitWebView *page, const gchar *param);
+toggle_insert_mode(WebKitWebView *page, const gchar *param);
 
 static void
 load_uri (WebKitWebView * web_view, const gchar *param);