Skip to content

Commit

Permalink
Fix #1765: detect and ignore false mouse click
Browse files Browse the repository at this point in the history
  • Loading branch information
jarun committed Feb 3, 2024
1 parent d1271d4 commit 505f46a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/nnn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1312,14 +1312,14 @@ static char *abspath(const char *filepath, char *cwd, char *buf)
}

/* finds abspath of link pointed by filepath, taking cwd into account */
static char *bmtarget(const char *filepath, char *cwd, char *buf)
static char *bmtarget(const char *filepath, char *cwd, char *buf)
{
char target[PATH_MAX + 1];
ssize_t n = readlink(filepath, target, PATH_MAX);
if (n != -1) {
target[n] = '\0';
return abspath(target, cwd, buf);
}
}
return NULL;
}

Expand Down Expand Up @@ -3436,7 +3436,14 @@ static int filterentries(char *path, char *lastname)
continue;
#ifndef NOMOUSE
case KEY_MOUSE:
{
MEVENT event = {0};
getmouse(&event);
if (event.bstate == 0)
continue;
ungetmouse(&event);
goto end;
}
#endif
case ESC:
if (handle_alt_key(ch) != ERR) {
Expand Down

0 comments on commit 505f46a

Please sign in to comment.