nsvi: fix insert command when entered in exline v2 PROPOSED

Pranjal Kole: 1
 nsvi: fix insert command when entered in exline

 1 files changed, 4 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/visurf-devel/patches/27847/mbox | git am -3
Learn more about email & git

[PATCH v2] nsvi: fix insert command when entered in exline Export this patch

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

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 =
	switch (event) {
		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;