mirror of
https://github.com/jarun/nnn.git
synced 2025-02-26 03:01:32 +00:00
Clear history when entering directory
This commit is contained in:
parent
41235445e7
commit
7f4c1a447b
1 changed files with 4 additions and 6 deletions
10
nnn.c
10
nnn.c
|
@ -508,6 +508,8 @@ initcurses(void)
|
||||||
intrflush(stdscr, FALSE);
|
intrflush(stdscr, FALSE);
|
||||||
keypad(stdscr, TRUE);
|
keypad(stdscr, TRUE);
|
||||||
curs_set(FALSE); /* Hide cursor */
|
curs_set(FALSE); /* Hide cursor */
|
||||||
|
start_color();
|
||||||
|
use_default_colors();
|
||||||
timeout(1000); /* One second */
|
timeout(1000); /* One second */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1286,12 +1288,7 @@ browse(char *ipath, char *ifilter)
|
||||||
newpath[0] = '\0';
|
newpath[0] = '\0';
|
||||||
lastdir[0] = '\0'; /* Can't move back from initial directory */
|
lastdir[0] = '\0'; /* Can't move back from initial directory */
|
||||||
begin:
|
begin:
|
||||||
|
if (populate(path, oldpath, fltr) == -1) {
|
||||||
if (sel == SEL_GOIN && S_ISDIR(sb.st_mode))
|
|
||||||
r = populate(path, NULL, fltr);
|
|
||||||
else
|
|
||||||
r = populate(path, oldpath, fltr);
|
|
||||||
if (r == -1) {
|
|
||||||
printwarn();
|
printwarn();
|
||||||
goto nochange;
|
goto nochange;
|
||||||
}
|
}
|
||||||
|
@ -1375,6 +1372,7 @@ nochange:
|
||||||
xstrlcpy(lastdir, path, sizeof(lastdir));
|
xstrlcpy(lastdir, path, sizeof(lastdir));
|
||||||
|
|
||||||
xstrlcpy(path, newpath, sizeof(path));
|
xstrlcpy(path, newpath, sizeof(path));
|
||||||
|
oldpath[0] = '\0';
|
||||||
/* Reset filter */
|
/* Reset filter */
|
||||||
xstrlcpy(fltr, ifilter, sizeof(fltr));
|
xstrlcpy(fltr, ifilter, sizeof(fltr));
|
||||||
goto begin;
|
goto begin;
|
||||||
|
|
Loading…
Add table
Reference in a new issue