aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-08-25 21:49:55 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-08-25 21:49:55 +0530
commit776d782fcfed2669f0e935420eefd66daff66d37 (patch)
tree32ed3263a6a8c49734f90ae1f09719ef986ceea2
parent4196af94f78018cfd922be84f0b51556aae95446 (diff)
downloadnnn-776d782fcfed2669f0e935420eefd66daff66d37.tar.gz
Clear rename prompt with Ctrl-L
-rw-r--r--README.md2
-rw-r--r--nnn.12
-rw-r--r--nnn.c8
3 files changed, 9 insertions, 3 deletions
diff --git a/README.md b/README.md
index d456555..c7079b7 100644
--- a/README.md
+++ b/README.md
@@ -221,7 +221,7 @@ To cook yourself, download the [latest stable release](https://github.com/jarun/
o | Open dir in file manager
p | Open entry in PAGER
^K | Invoke file path copier
- ^L | Force a redraw, unfilter
+ ^L | Redraw, clear prompt
? | Show help, settings
Q | Quit and change dir
q, ^Q | Quit
diff --git a/nnn.1 b/nnn.1
index b522c01..230ca96 100644
--- a/nnn.1
+++ b/nnn.1
@@ -94,7 +94,7 @@ Open current entry in PAGER (fallback less)
.It Ic ^K
Invoke file path copier
.It Ic ^L
-Force a redraw, unfilter
+Redraw, clear prompt
.It Ic \&?
Toggle help and settings screen
.It Ic Q
diff --git a/nnn.c b/nnn.c
index be2c10c..3e16ee0 100644
--- a/nnn.c
+++ b/nnn.c
@@ -1033,6 +1033,12 @@ xreadline(char *fname)
if (*ch == KEY_ENTER || *ch == '\n' || *ch == '\r')
break;
+ if (*ch == CONTROL('L')) {
+ clearprompt();
+ len = pos = 0;
+ continue;
+ }
+
if (pos < buflen) {
memmove(buf + pos + 1, buf + pos, (len - pos) << 2);
buf[pos] = *ch;
@@ -1655,7 +1661,7 @@ show_help(char *path)
"eo | Open dir in file manager\n"
"ep | Open entry in PAGER\n"
"d^K | Invoke file path copier\n"
- "d^L | Force a redraw, unfilter\n"
+ "d^L | Redraw, clear prompt\n"
"e? | Show help, settings\n"
"eQ | Quit and change dir\n"
"aq, ^Q | Quit\n\n");