From: Arun Prakash Jana <engineerarun@gmail.com>
Date: Sat, 5 Jan 2019 21:38:46 +0000 (+0530)
Subject: Don't lose filename on second escape
X-Git-Tag: v2.3~149
X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=72e305759e66cbd6d7e6aa139e93ff5980c66cad;p=nnn.git

Don't lose filename on second escape
---

diff --git a/src/nnn.c b/src/nnn.c
index a0c956b0..a55f666b 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1259,7 +1259,8 @@ static int filterentries(char *path)
 			printprompt(ln);
 			continue;
 		case 27: /* Exit filter mode on Escape */
-			cur = oldcur;
+			if (len == 1)
+				cur = oldcur;
 			*ch = CONTROL('L');
 			goto end;
 		}