From: Daniel Carl Date: Fri, 5 Dec 2014 09:28:15 +0000 (+0100) Subject: Don't switch from command to input mode if page says so. X-Git-Url: https://git.owens.tech/editable-focus.html/editable-focus.html/git?a=commitdiff_plain;h=19b457d0f3ca303cf685ba4e3f30a6d8d31f5c03;p=vimb.git Don't switch from command to input mode if page says so. --- diff --git a/src/dom.c b/src/dom.c index 561e3b8..d7bd80e 100644 --- a/src/dom.c +++ b/src/dom.c @@ -202,8 +202,11 @@ static gboolean element_is_visible(WebKitDOMDOMWindow* win, WebKitDOMElement* el static gboolean auto_insert(Element *element) { - /* don't change mode if we are in pass through mode */ - if (vb.mode->id != 'p' && dom_is_editable(element)) { + /* Change only the mode if we are in normal mode - passthrough should not + * be disturbed by this and if the user iy typing into inputbox we don't + * want to remove the content and force a switch to input mode. And to + * switch to input mode when this is already active makes no sense. */ + if (vb.mode->id == 'n' && dom_is_editable(element)) { mode_enter('i'); return true;