nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 81226db24e3bde6f781bc13d6612cc7fe7ff9f13
parent 675016eb553bd6316a83f92ae7c1292d71b3c7d4
Author: Arun <engineerarun@gmail.com>
Date:   Thu, 24 Mar 2022 03:05:47 +0530

Merge pull request #1330 from N-R-K/prompt_clearsel

native prompt: clear selection on successful operation
Diffstat:
Msrc/nnn.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/nnn.c b/src/nnn.c @@ -5373,7 +5373,7 @@ static bool prompt_run(void) { bool ret = FALSE; char *cmdline, *next; - int cnt_j, cnt_J; + int cnt_j, cnt_J, cmd_ret; size_t len; const char *xargs_j = "xargs -0 -I{} %s < %s"; @@ -5433,7 +5433,9 @@ static bool prompt_run(void) else if (cnt_J) snprintf(cmd, CMD_LEN_MAX + 32, xargs_J, cmdline, selpath); - spawn(shell, "-c", (cnt_j || cnt_J) ? cmd : cmdline, NULL, F_CLI | F_CONFIRM); + cmd_ret = spawn(shell, "-c", (cnt_j || cnt_J) ? cmd : cmdline, NULL, F_CLI | F_CONFIRM); + if ((cnt_j || cnt_J) && cmd_ret == 0) + clearselection(); } return ret;