Limit nav-as-you-type toggle to click on last 2 rows

This commit is contained in:
Arun Prakash Jana 2019-07-28 13:10:56 +05:30
parent 43762d58c5
commit 46aa0adafa
No known key found for this signature in database
GPG key ID: A75979F35C080412
2 changed files with 9 additions and 8 deletions

View file

@ -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 |

View file

@ -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 */