From: Daniel Carl Date: Thu, 16 Oct 2014 13:05:00 +0000 (+0200) Subject: Fix for WYSIWYG editor on github (#114). X-Git-Url: https://git.owens.tech/assets/static/git-logo.png/assets/static/git-logo.png/git?a=commitdiff_plain;h=4f04c3a91b951a557103e823e22739193ee8ad01;p=vimb.git Fix for WYSIWYG editor on github (#114). For these editors the click does not reach the editable element, so that vimb does not switch to insert mode. But the textarea is focused when the click appears, so that we can pick up the click event and check if the focused element is editable. I hope this will not break other pages that heavily depend on JavaScript. --- diff --git a/src/main.c b/src/main.c index f503889..3325072 100644 --- a/src/main.c +++ b/src/main.c @@ -1143,6 +1143,11 @@ static gboolean button_relase_cb(WebKitWebView *webview, GdkEventButton *event) * mode when the user clicks into a form field */ mode_enter('i'); propagate = true; + } else if (vb.mode->id == 'n' && dom_is_editable(dom_get_active_element(vb.gui.webview))) { + /* if the focus is on an editable element after the click - switch + * also to insert mode - this seems to work also for WYSIWYG editors */ + mode_enter('i'); + propagate = true; } g_object_unref(result);