mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-15 10:18:39 -09:00
allow browsing the directory during scanning
This commit is contained in:
parent
8d58297328
commit
9682a488ef
3 changed files with 12 additions and 3 deletions
|
|
@ -259,6 +259,15 @@ void browse_draw() {
|
||||||
char *tmp;
|
char *tmp;
|
||||||
int selected = 0, i;
|
int selected = 0, i;
|
||||||
|
|
||||||
|
extern struct dir *root; /* root directory struct we're scanning */
|
||||||
|
if (pstate == ST_CALC) {
|
||||||
|
static bool open = false;
|
||||||
|
if (!open) {
|
||||||
|
dirlist_open(root);
|
||||||
|
open = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
erase();
|
erase();
|
||||||
t = dirlist_get(0);
|
t = dirlist_get(0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
#include <khashl.h>
|
#include <khashl.h>
|
||||||
|
|
||||||
|
|
||||||
static struct dir *root; /* root directory struct we're scanning */
|
struct dir *root; /* root directory struct we're scanning */
|
||||||
static struct dir *curdir; /* directory item that we're currently adding items to */
|
static struct dir *curdir; /* directory item that we're currently adding items to */
|
||||||
static struct dir *orig; /* original directory, when refreshing an already scanned dir */
|
static struct dir *orig; /* original directory, when refreshing an already scanned dir */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ static long lastupdate = 999;
|
||||||
|
|
||||||
static void screen_draw() {
|
static void screen_draw() {
|
||||||
switch(pstate) {
|
switch(pstate) {
|
||||||
case ST_CALC: dir_draw(); break;
|
case ST_CALC: browse_draw(); break;
|
||||||
case ST_BROWSE: browse_draw(); break;
|
case ST_BROWSE: browse_draw(); break;
|
||||||
case ST_HELP: help_draw(); break;
|
case ST_HELP: help_draw(); break;
|
||||||
case ST_SHELL: shell_draw(); break;
|
case ST_SHELL: shell_draw(); break;
|
||||||
|
|
@ -98,7 +98,7 @@ int input_handle(int wait) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
switch(pstate) {
|
switch(pstate) {
|
||||||
case ST_CALC: return dir_key(ch);
|
case ST_CALC: return browse_key(ch);
|
||||||
case ST_BROWSE: return browse_key(ch);
|
case ST_BROWSE: return browse_key(ch);
|
||||||
case ST_HELP: return help_key(ch);
|
case ST_HELP: return help_key(ch);
|
||||||
case ST_DEL: return delete_key(ch);
|
case ST_DEL: return delete_key(ch);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue