~sircmpwn/visurf-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH v3] nsvi: fix insert command when entered in exline

Details
Message ID
<20211231080722.17221-1-pranjal.kole7@gmail.com>
DKIM signature
missing
Download raw message
Patch: +4 -1
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 not available directly to visurf, so
browser_window_get_editor_flags has to be used to get its value.
---
The previous patch worked fine while testing for some reason, but the
logic was incorrect. ed_flags & BW_EDITOR_CAN_PASTE will give 1 if
BW_EDITOR_CAN_PASTE is set and 0 if it is not set, and
BW_EDITOR_CAN_PASTE will be set when bw->can_edit is true. We want false
when bw->can_edit is true and true when it is false. Therefore, this is
the correct logic.
 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..d8d3020bd 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
Details
Message ID
<CGTCFXXAAGY9.ZYA4HNM0N8ZN@taiga>
In-Reply-To
<20211231080722.17221-1-pranjal.kole7@gmail.com> (view parent)
DKIM signature
missing
Download raw message
Pushed with some edits for style. Thanks!

To git@git.sr.ht:~sircmpwn/visurf
   6196e731e..940de57e2  master -> master
Reply to thread Export thread (mbox)