Do not store force quit option in session

This commit is contained in:
Arun Prakash Jana 2020-02-29 20:06:39 +05:30
parent 56eb4cab6e
commit b52d17caa2
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 4 additions and 5 deletions

View File

@ -254,9 +254,8 @@ typedef struct {
uint selmode : 1; /* Set when selecting files */ uint selmode : 1; /* Set when selecting files */
uint showdetail : 1; /* Clear to show fewer file info */ uint showdetail : 1; /* Clear to show fewer file info */
uint ctxactive : 1; /* Context active or not */ uint ctxactive : 1; /* Context active or not */
uint reserved1 : 2; uint reserved1 : 3;
/* The following settings are global */ /* The following settings are global */
uint forcequit : 1; /* Do not confirm when quitting program */
uint curctx : 2; /* Current context number */ uint curctx : 2; /* Current context number */
uint dircolor : 1; /* Current status of dir color */ uint dircolor : 1; /* Current status of dir color */
uint picker : 1; /* Write selection to user-specified file */ uint picker : 1; /* Write selection to user-specified file */
@ -309,7 +308,6 @@ static settings cfg = {
0, /* showdetail */ 0, /* showdetail */
1, /* ctxactive */ 1, /* ctxactive */
0, /* reserved1 */ 0, /* reserved1 */
0, /* forcequit */
0, /* curctx */ 0, /* curctx */
0, /* dircolor */ 0, /* dircolor */
0, /* picker */ 0, /* picker */
@ -398,6 +396,7 @@ static char g_pipepath[TMP_LEN_MAX] __attribute__ ((aligned));
#define STATE_AUTONEXT 0x10 #define STATE_AUTONEXT 0x10
#define STATE_MSG 0x20 #define STATE_MSG 0x20
#define STATE_TRASH 0x40 #define STATE_TRASH 0x40
#define STATE_FORCEQUIT 0x80
static uchar g_states; static uchar g_states;
@ -6145,7 +6144,7 @@ nochange:
setdirwatch(); setdirwatch();
goto begin; goto begin;
} }
} else if (!cfg.forcequit) { } else if (!(g_states & STATE_FORCEQUIT)) {
for (r = 0; r < CTX_MAX; ++r) for (r = 0; r < CTX_MAX; ++r)
if (r != cfg.curctx && g_ctx[r].c_cfg.ctxactive) { if (r != cfg.curctx && g_ctx[r].c_cfg.ctxactive) {
r = get_input(messages[MSG_QUIT_ALL]); r = get_input(messages[MSG_QUIT_ALL]);
@ -6649,7 +6648,7 @@ int main(int argc, char *argv[])
} }
break; break;
case 'Q': case 'Q':
cfg.forcequit = 1; g_states |= STATE_FORCEQUIT;
break; break;
case 'r': case 'r':
#ifdef __linux__ #ifdef __linux__