aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-03-29 15:59:56 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-03-29 15:59:56 +0530
commitad0fb1df8cc31abba5967752e1b125a6b2cda53c (patch)
treecb954f0c17f85628f7b872ce53f75391e4ac0507
parente67e78f9f13a24cd1ed50aeb3c3f6412962f6356 (diff)
downloadnnn-ad0fb1df8cc31abba5967752e1b125a6b2cda53c.tar.gz
Implement navigation roll over
-rw-r--r--README.md5
-rw-r--r--noice.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/README.md b/README.md
index 1617dcd..fa8bcd2 100644
--- a/README.md
+++ b/README.md
@@ -42,8 +42,9 @@ I chose to fork noice because:
### Fork toppings
-- Behaviour
+- Behaviour and navigation
- Case-insensitive alphabetic content listing instead of upper case first.
+ - Roll over at the first and last entries of a directory (with Up/Down keys).
- File associations
- Environment variable `NOICE_OPENER` to override all associations and open all files with your desktop environments default file opener. Examples:
@@ -97,7 +98,7 @@ Start noice (default: current directory):
| `.` | toggle hide dot files |
| `t` | toggle sort by modified time |
| `!` | spawn a shell in current dir |
-| `e` | edit item in `vi` |
+| `e` | edit item in `vim` |
| `p` | open item with `less` pager |
| `z` | run `top` |
| `Ctrl-l` | redraw window |
diff --git a/noice.c b/noice.c
index e9e4e65..2d562ae 100644
--- a/noice.c
+++ b/noice.c
@@ -746,10 +746,16 @@ nochange:
case SEL_NEXT:
if (cur < ndents - 1)
cur++;
+ else if (ndents)
+ /* Roll over, set cursor to first entry */
+ cur = 0;
break;
case SEL_PREV:
if (cur > 0)
cur--;
+ else if (ndents)
+ /* Roll over, set cursor to last entry */
+ cur = ndents - 1;
break;
case SEL_PGDN:
if (cur < ndents - 1)