aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-04-28 17:57:06 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-04-28 17:57:38 +0530
commit7f4c1a447bba6e54ea8258a3af09c7e4b025ea8e (patch)
treed503d6453a21011df954619a1f1cbc8e3248c538
parent41235445e714fa55bdc77328212628cb3dd34d58 (diff)
downloadnnn-7f4c1a447bba6e54ea8258a3af09c7e4b025ea8e.tar.gz
Clear history when entering directory
-rw-r--r--nnn.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/nnn.c b/nnn.c
index 56a6e32..c23e158 100644
--- a/nnn.c
+++ b/nnn.c
@@ -508,6 +508,8 @@ initcurses(void)
intrflush(stdscr, FALSE);
keypad(stdscr, TRUE);
curs_set(FALSE); /* Hide cursor */
+ start_color();
+ use_default_colors();
timeout(1000); /* One second */
}
@@ -1286,12 +1288,7 @@ browse(char *ipath, char *ifilter)
newpath[0] = '\0';
lastdir[0] = '\0'; /* Can't move back from initial directory */
begin:
-
- if (sel == SEL_GOIN && S_ISDIR(sb.st_mode))
- r = populate(path, NULL, fltr);
- else
- r = populate(path, oldpath, fltr);
- if (r == -1) {
+ if (populate(path, oldpath, fltr) == -1) {
printwarn();
goto nochange;
}
@@ -1375,6 +1372,7 @@ nochange:
xstrlcpy(lastdir, path, sizeof(lastdir));
xstrlcpy(path, newpath, sizeof(path));
+ oldpath[0] = '\0';
/* Reset filter */
xstrlcpy(fltr, ifilter, sizeof(fltr));
goto begin;