Code refactor

This commit is contained in:
Arun Prakash Jana 2019-12-27 09:26:20 +05:30
parent b455abf944
commit a32b3eac14
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 15 additions and 27 deletions

View File

@ -5460,36 +5460,24 @@ nochange:
break; // fallthrough break; // fallthrough
} }
if (sel == SEL_QUITCD || getenv("NNN_TMPFILE")) { /* CD on Quit */
/* In vim picker mode, clear selection and exit */ /* In vim picker mode, clear selection and exit */
if (cfg.picker) {
/* Picker mode: reset buffer or clear file */ /* Picker mode: reset buffer or clear file */
selbufpos = 0; if (sel == SEL_QUITCD || getenv("NNN_TMPFILE"))
} else if (!write_lastdir(path)) { cfg.picker ? selbufpos = 0 : write_lastdir(path);
presel = MSGWAIT;
goto nochange;
}
}
return; return;
default: default:
if (xlines != LINES || xcols != COLS) { if (xlines != LINES || xcols != COLS)
idle = 0; setdirwatch(); /* Terminal resized */
setdirwatch(); else if (idletimeout && idle == idletimeout)
if (ndents) lock_terminal(); /* Locker */
copycurname(); else
goto begin;
}
/* Locker */
if (idletimeout && idle == idletimeout) {
idle = 0;
lock_terminal();
if (ndents)
copycurname();
goto begin;
}
goto nochange; goto nochange;
idle = 0;
if (ndents)
copycurname();
goto begin;
} /* switch (sel) */ } /* switch (sel) */
} }
} }