summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorDaniel Carl <danielcarl@gmx.de>2013-06-13 00:13:43 +0200
committerDaniel Carl <danielcarl@gmx.de>2013-06-13 09:58:54 +0200
commit57711abd9fb230e722ac52df164aa79d4970cec9 (patch)
tree571a2433ccbb5c647ed29ee1757c63cfb9368e16 /src/main.c
parent0a13db75be823f15fe4e5b4eacd604718968c111 (diff)
Fixed leaving input mode on load commit (#33).
If a page was loaded and text was typed into the inputbox, the input mode was left on WEBKIT_LOAD_COMMITED. Now we keep in insert mode also if the page loads to allow to type in a command into inputbox. Moved modkey unset to keybind.c where the modkeys are set.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c
index 4fc3921..fc84477 100644
--- a/src/main.c
+++ b/src/main.c
@@ -149,9 +149,6 @@ gboolean vb_load_uri(const Arg *arg)
uri = g_strdup_printf("http://%s", path);
}
- /* change state to normal mode */
- vb_set_mode(VB_MODE_NORMAL, false);
-
if (arg->i == VB_TARGET_NEW) {
guint i = 0;
char *cmd[7], xid[64];
@@ -205,8 +202,6 @@ gboolean vb_set_clipboard(const Arg *arg)
*/
gboolean vb_set_mode(Mode mode, gboolean clean)
{
- vb.state.modkey = vb.state.count = 0;
-
/* process only if mode has changed */
if (vb.state.mode != mode) {
/* leaf the old mode */
@@ -421,8 +416,12 @@ static void webview_load_status_cb(WebKitWebView *view, GParamSpec *pspec)
run_user_script(frame);
}
- /* status bar is updated by vb_set_mode */
- vb_set_mode(VB_MODE_NORMAL , false);
+ if (vb.state.mode & VB_MODE_INSERT) {
+ /* status bar is updated by vb_set_mode */
+ vb_set_mode(VB_MODE_NORMAL, false);
+ } else {
+ vb_update_statusbar();
+ }
vb_update_urlbar(uri);
break;