From: Arun Prakash Jana <engineerarun@gmail.com>
Date: Fri, 29 Oct 2021 15:57:02 +0000 (+0530)
Subject: Position cursor in correct place for long names
X-Git-Tag: v4.4~26
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=473cd271b547beba896e887fc99bbb2ba63dfe9a;p=nnn.git

Position cursor in correct place for long names
---

diff --git a/src/nnn.c b/src/nnn.c
index aea0b693..accef97b 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3486,7 +3486,7 @@ static char *xreadline(const char *prefill, const char *prompt)
 		buf[len] = ' ';
 		attron(COLOR_PAIR(cfg.curctx + 1));
 		if (pos > (size_t)(xcols - x)) {
-			mvaddnwstr(xlines - 1, x, buf + (pos - (xcols - x)), xcols - x);
+			mvaddnwstr(xlines - 1, x, buf + (pos - (xcols - x) + 1), xcols - x);
 			move(xlines - 1, xcols - 1);
 		} else {
 			mvaddnwstr(xlines - 1, x, buf, len + 1);