mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Code refactor
This commit is contained in:
parent
b455abf944
commit
a32b3eac14
42
src/nnn.c
42
src/nnn.c
|
@ -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 */
|
if (sel == SEL_QUITCD || getenv("NNN_TMPFILE"))
|
||||||
selbufpos = 0;
|
cfg.picker ? selbufpos = 0 : write_lastdir(path);
|
||||||
} else if (!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;
|
goto nochange;
|
||||||
}
|
|
||||||
|
|
||||||
/* Locker */
|
idle = 0;
|
||||||
if (idletimeout && idle == idletimeout) {
|
if (ndents)
|
||||||
idle = 0;
|
copycurname();
|
||||||
lock_terminal();
|
goto begin;
|
||||||
if (ndents)
|
|
||||||
copycurname();
|
|
||||||
goto begin;
|
|
||||||
}
|
|
||||||
|
|
||||||
goto nochange;
|
|
||||||
} /* switch (sel) */
|
} /* switch (sel) */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue