diff --git a/src/main.c b/src/main.c index 97239aaf146863c1c16ae0774d543ef143a350f0..1835afc2e7627df85272916b191392e8e64e4bfb 100644 --- a/src/main.c +++ b/src/main.c @@ -35,9 +35,10 @@ #include <unistd.h> -int sflags; int pstate; +int min_rows = 17, + min_cols = 60; void screen_draw() { int n = 1; @@ -57,8 +58,8 @@ int input_handle(int wait) { screen_draw(); while((ch = getch()) != ERR) { if(ch == KEY_RESIZE) { - if(ncresize((sflags & SF_IGNS ? 0 : 17), (sflags * SF_IGNS ? 0 : 60))) - sflags |= SF_IGNS; + if(ncresize(min_rows, min_cols)) + min_rows = min_cols = 0; screen_draw(); continue; } @@ -79,7 +80,6 @@ void argv_parse(int argc, char **argv, char *dir) { /* load defaults */ memset(dir, 0, PATH_MAX); getcwd(dir, PATH_MAX); - sflags = 0; calc_delay = 100; calc_smfs = 0; @@ -150,8 +150,8 @@ int main(int argc, char **argv) { noecho(); curs_set(0); keypad(stdscr, TRUE); - if(ncresize((sflags & SF_IGNS ? 0 : 17), (sflags * SF_IGNS ? 0 : 60))) - sflags |= SF_IGNS; + if(ncresize(min_rows, min_cols)) + min_rows = min_cols = 0; while(pstate != ST_QUIT) { if(pstate == ST_CALC) diff --git a/src/ncdu.h b/src/ncdu.h index 5bdf1c6a2d6708409af0d27db2c95874b5e4daa6..5493ec3dbddcdffec3eb1e545f3b0f3712fcf2e7 100644 --- a/src/ncdu.h +++ b/src/ncdu.h @@ -58,11 +58,6 @@ #define FF_SERR 0x20 /* error in subdirectory */ #define FF_BSEL 0x40 /* selected */ -/* Settings Flags (int sflags) */ -#define SF_IGNS 0x04 /* ignore too small terminal sizes */ -#define SF_NOCFM 0x08 /* don't confirm file deletion */ -#define SF_IGNE 0x10 /* ignore errors when deleting */ - /* Program states */ #define ST_CALC 0 #define ST_BROWSE 1 @@ -80,9 +75,6 @@ struct dir { unsigned char flags; }; -/* global settings */ -extern int sflags; - /* program state */ extern int pstate;