mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Termux improvement: toggle nav-as-you-type
2 changes: - Toggle nav-as-you-type with left single/double click below last entry - Handle mouse events when filter is on
This commit is contained in:
parent
713eed0a21
commit
bfc8d0a7d3
|
@ -267,8 +267,9 @@ Note: Help & settings, file details, media info and archive listing are shown in
|
||||||
|---| --- |
|
|---| --- |
|
||||||
| Left single on context number | Visit context |
|
| Left single on context number | Visit context |
|
||||||
| Left single on top row after context numbers | Visit parent |
|
| Left single on top row after context numbers | Visit parent |
|
||||||
|
| Left single/double after last entry | Toggle nav-as-you-type |
|
||||||
| Left single | Select context or entry |
|
| Left single | Select context or entry |
|
||||||
| Left double | Select context or open file/directory |
|
| Left double | Select context or open entry |
|
||||||
|
|
||||||
##### Leader key
|
##### Leader key
|
||||||
|
|
||||||
|
|
21
src/nnn.c
21
src/nnn.c
|
@ -1696,6 +1696,7 @@ static int filterentries(char *path)
|
||||||
|
|
||||||
printprompt(ln);
|
printprompt(ln);
|
||||||
continue;
|
continue;
|
||||||
|
case KEY_MOUSE: // fallthrough
|
||||||
case 27: /* Exit filter mode on Escape */
|
case 27: /* Exit filter mode on Escape */
|
||||||
if (len == 1)
|
if (len == 1)
|
||||||
cur = oldcur;
|
cur = oldcur;
|
||||||
|
@ -3392,13 +3393,27 @@ nochange:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Handle clicking on a file */
|
if (2 <= event.y && event.y < xlines - 2)
|
||||||
if (2 <= event.y && event.y < xlines - 2) {
|
|
||||||
r = curscroll + (event.y - 2);
|
r = curscroll + (event.y - 2);
|
||||||
|
|
||||||
if (r >= ndents)
|
/* Toggle filter mode on left click on last line */
|
||||||
|
if (event.y >= xlines - 2 || r >= ndents) {
|
||||||
|
cfg.filtermode ^= 1;
|
||||||
|
if (cfg.filtermode) {
|
||||||
|
presel = FILTER;
|
||||||
goto nochange;
|
goto nochange;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Start watching the directory */
|
||||||
|
dir_changed = TRUE;
|
||||||
|
|
||||||
|
if (ndents)
|
||||||
|
copycurname();
|
||||||
|
goto begin;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Handle clicking on a file */
|
||||||
|
if (2 <= event.y && event.y < xlines - 2) {
|
||||||
move_cursor(r, 1);
|
move_cursor(r, 1);
|
||||||
|
|
||||||
/*Single click just selects, double click also opens */
|
/*Single click just selects, double click also opens */
|
||||||
|
|
Loading…
Reference in a new issue