mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Minor refactor
This commit is contained in:
parent
928f325a74
commit
a0339adf84
12
src/nnn.c
12
src/nnn.c
|
@ -4964,17 +4964,17 @@ nochange:
|
||||||
switch (sel) {
|
switch (sel) {
|
||||||
case SEL_CLICK:
|
case SEL_CLICK:
|
||||||
if (getmouse(&event) != OK)
|
if (getmouse(&event) != OK)
|
||||||
goto nochange; // fallthrough
|
goto nochange;
|
||||||
case SEL_BACK:
|
|
||||||
/* Handle clicking on a context at the top */
|
/* Handle clicking on a context at the top */
|
||||||
if (sel == SEL_CLICK && event.bstate == BUTTON1_PRESSED && event.y == 0) {
|
if (event.bstate == BUTTON1_PRESSED && event.y == 0) {
|
||||||
/* Get context from: "[1 2 3 4]..." */
|
/* Get context from: "[1 2 3 4]..." */
|
||||||
r = event.x >> 1;
|
r = event.x >> 1;
|
||||||
|
|
||||||
/* If clicked after contexts, go to parent */
|
/* If clicked after contexts, go to parent */
|
||||||
if (r >= CTX_MAX)
|
if (r >= CTX_MAX)
|
||||||
sel = SEL_BACK;
|
sel = SEL_BACK;
|
||||||
else if (r >= 0 && r < CTX_MAX && r != cfg.curctx) {
|
else if (r >= 0 && r != cfg.curctx) {
|
||||||
if (cfg.selmode)
|
if (cfg.selmode)
|
||||||
lastappendpos = selbufpos;
|
lastappendpos = selbufpos;
|
||||||
|
|
||||||
|
@ -4988,8 +4988,8 @@ nochange:
|
||||||
setdirwatch();
|
setdirwatch();
|
||||||
goto begin;
|
goto begin;
|
||||||
}
|
}
|
||||||
}
|
} // fallthrough
|
||||||
|
case SEL_BACK:
|
||||||
if (sel == SEL_BACK) {
|
if (sel == SEL_BACK) {
|
||||||
dir = visit_parent(path, newpath, &presel);
|
dir = visit_parent(path, newpath, &presel);
|
||||||
if (!dir)
|
if (!dir)
|
||||||
|
|
Loading…
Reference in a new issue