Browse Source

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

master
Arun Prakash Jana 5 years ago
parent
commit
46aa0adafa
No known key found for this signature in database GPG Key ID: A75979F35C080412
2 changed files with 9 additions and 8 deletions
  1. +1
    -1
      README.md
  2. +8
    -7
      src/nnn.c

+ 1
- 1
README.md 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 |




+ 8
- 7
src/nnn.c View File

@@ -3468,11 +3468,8 @@ nochange:
} }
#endif #endif


if (2 <= event.y && event.y < xlines - 2)
r = curscroll + (event.y - 2);

/* Toggle filter mode on left click on last line */
if (event.y >= xlines - 2 || r >= ndents) {
/* Toggle filter mode on left click on last 2 lines */
if (event.y >= xlines - 2) {
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…
Cancel
Save