The :insert command was not working when typed in exline mode. This has
been fixed by using the bw->can_edit flag to determine whether the
window should go to normal mode.
The bw->can_edit flag is set by browser_window_remove_caret. In most
cases, it is set to false, except for CONTENT_MSG_REFORMAT and
CONTENT_CARET_HIDE.
This flag is not available directly to visurf, so
browser_window_get_editor_flags has to be used to get its value.
---
frontends/visurf/window.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/frontends/visurf/window.c b/frontends/visurf/window.c
index 7e6d4d7c3..a037596a7 100644
--- a/frontends/visurf/window.c+++ b/frontends/visurf/window.c
@@ -947,11 +947,14 @@ static nserror
nsvi_window_event(struct gui_window *gw, enum gui_window_event event)
{
struct nsvi_window *win = gw->window;
+ browser_editor_flags ed_flags =+ browser_window_get_editor_flags(gw->bw); switch (event) {
case GW_EVENT_REMOVE_CARET:
gw->caret.enabled = false;
if (win->tabs[win->tab] == gw) {
- if (win->mode == INSERT) {+ if (win->mode == INSERT &&+ (ed_flags ^ BW_EDITOR_CAN_PASTE)) { win->mode = NORMAL;
}
request_frame(win);
--
2.34.1