From 7677cd4417070f799895dbda83e01b39f42b6184 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sun, 19 Jan 2020 10:49:40 +0530 Subject: [PATCH] Copy current name in API --- src/nnn.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/nnn.c b/src/nnn.c index 36b2d1d2..2d4e80df 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -2279,8 +2279,11 @@ end: if (*ch != 27 && *ch != '\t' && *ch != KEY_UP && *ch != KEY_DOWN && *ch != CONTROL('T')) { ln[0] = ln[1] = '\0'; move_cursor(cur, 0); - } else if (ndents) - xstrlcpy(lastname, dents[cur].name, NAME_MAX + 1); + } + + /* Save current */ + if (ndents) + copycurname(); curs_set(FALSE); settimeout(); @@ -5015,10 +5018,6 @@ nochange: #endif presel = filterentries(path, lastname); - /* Save current */ - if (ndents) - copycurname(); - if (presel == 27) { presel = 0; break;