mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
Limit nav-as-you-type toggle to click on last 2 rows
This commit is contained in:
parent
43762d58c5
commit
46aa0adafa
|
@ -281,7 +281,7 @@ 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/double on last 2 rows | Toggle nav-as-you-type |
|
||||||
| Left single | Select context or entry |
|
| Left single | Select context or entry |
|
||||||
| Left double | Select context or open entry |
|
| Left double | Select context or open entry |
|
||||||
|
|
||||||
|
|
15
src/nnn.c
15
src/nnn.c
|
@ -3468,11 +3468,8 @@ nochange:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (2 <= event.y && event.y < xlines - 2)
|
/* Toggle filter mode on left click on last 2 lines */
|
||||||
r = curscroll + (event.y - 2);
|
if (event.y >= xlines - 2) {
|
||||||
|
|
||||||
/* Toggle filter mode on left click on last line */
|
|
||||||
if (event.y >= xlines - 2 || r >= ndents) {
|
|
||||||
cfg.filtermode ^= 1;
|
cfg.filtermode ^= 1;
|
||||||
if (cfg.filtermode) {
|
if (cfg.filtermode) {
|
||||||
presel = FILTER;
|
presel = FILTER;
|
||||||
|
@ -3488,14 +3485,18 @@ nochange:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle clicking on a file */
|
/* Handle clicking on a file */
|
||||||
if (2 <= event.y && event.y < xlines - 2) {
|
r = curscroll + (event.y - 2);
|
||||||
|
if (2 <= event.y && event.y < xlines - 2 && r < ndents) {
|
||||||
move_cursor(r, 1);
|
move_cursor(r, 1);
|
||||||
|
|
||||||
/*Single click just selects, double click also opens */
|
/*Single click just selects, double click also opens */
|
||||||
if (event.bstate != BUTTON1_DOUBLE_CLICKED)
|
if (event.bstate != BUTTON1_DOUBLE_CLICKED)
|
||||||
break;
|
break;
|
||||||
} else
|
} else {
|
||||||
|
if (cfg.filtermode)
|
||||||
|
presel = FILTER;
|
||||||
goto nochange; // fallthrough
|
goto nochange; // fallthrough
|
||||||
|
}
|
||||||
case SEL_NAV_IN: // fallthrough
|
case SEL_NAV_IN: // fallthrough
|
||||||
case SEL_GOIN:
|
case SEL_GOIN:
|
||||||
/* Cannot descend in empty directories */
|
/* Cannot descend in empty directories */
|
||||||
|
|
Loading…
Reference in a new issue