mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
Fix picker mode
This commit is contained in:
parent
2d91768d88
commit
7d70a655e6
|
@ -4705,7 +4705,7 @@ nochange:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* move cursor to the next entry if this is not the last entry */
|
/* move cursor to the next entry if this is not the last entry */
|
||||||
if (cur != ndents - 1)
|
if (!cfg.picker && cur != ndents - 1)
|
||||||
move_cursor((cur + 1) % ndents, 0);
|
move_cursor((cur + 1) % ndents, 0);
|
||||||
break;
|
break;
|
||||||
case SEL_SELMUL:
|
case SEL_SELMUL:
|
||||||
|
@ -5206,8 +5206,7 @@ nochange:
|
||||||
/* In vim picker mode, clear selection and exit */
|
/* In vim picker mode, clear selection and exit */
|
||||||
if (cfg.picker) {
|
if (cfg.picker) {
|
||||||
/* Picker mode: reset buffer or clear file */
|
/* Picker mode: reset buffer or clear file */
|
||||||
if (selbufpos)
|
selbufpos = 0;
|
||||||
cfg.pickraw ? selbufpos = 0 : writesel(NULL, 0);
|
|
||||||
} else if (!write_lastdir(path)) {
|
} else if (!write_lastdir(path)) {
|
||||||
presel = MSGWAIT;
|
presel = MSGWAIT;
|
||||||
goto nochange;
|
goto nochange;
|
||||||
|
@ -5715,6 +5714,9 @@ int main(int argc, char *argv[])
|
||||||
if (opt != (int)(selbufpos))
|
if (opt != (int)(selbufpos))
|
||||||
xerror();
|
xerror();
|
||||||
}
|
}
|
||||||
|
} else if (cfg.picker) {
|
||||||
|
if (selbufpos)
|
||||||
|
writesel(pselbuf, selbufpos - 1);
|
||||||
} else if (!cfg.picker && g_selpath)
|
} else if (!cfg.picker && g_selpath)
|
||||||
unlink(g_selpath);
|
unlink(g_selpath);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue