~emersion/mrsh-dev

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 imrsh] Fix history cycling

Details
Message ID
<20210320111615.23452-1-karl@rielaender.org>
DKIM signature
pass
Download raw message
Patch: +3 -2
Previously, the displayed command didn't change when switching cycling
direction. This resolves the issue.
---
 src/history.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/history.c b/src/history.c
index cf7f966..16c024e 100644
--- a/src/history.c
+++ b/src/history.c
@@ -151,6 +151,7 @@ const char *imrsh_history_prev(const struct imrsh_history *history,
{
	if (cursor->prev == NULL) {
		cursor->prev = history->tail;
		return cursor->prev->cmd;
	}
	if (cursor->prev == history->entries) {
		return cursor->prev->cmd;
@@ -158,7 +159,7 @@ const char *imrsh_history_prev(const struct imrsh_history *history,
	struct imrsh_history_entry *prev = cursor->prev;
	cursor->next = prev;
	cursor->prev = prev->prev;
	return prev->cmd;
	return cursor->prev->cmd;
}

const char *imrsh_history_next(const struct imrsh_history *history,
@@ -171,5 +172,5 @@ const char *imrsh_history_next(const struct imrsh_history *history,
	struct imrsh_history_entry *next = cursor->next;
	cursor->prev = next;
	cursor->next = next->next;
	return next->cmd;
	return cursor->prev->cmd;
}
-- 
2.30.1
Details
Message ID
<CA275YNFYRES.2AI4GQRL0E7IH@taiga>
In-Reply-To
<20210320111615.23452-1-karl@rielaender.org> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Thanks!

To git@git.sr.ht:~sircmpwn/imrsh
   b97ad8e..  master -> master
Reply to thread Export thread (mbox)