mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 13:26:37 +00:00
Fix #1765: detect and ignore false mouse click
This commit is contained in:
parent
0738f39cf0
commit
94aeaccdbd
11
src/nnn.c
11
src/nnn.c
|
@ -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 */
|
/* 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];
|
char target[PATH_MAX + 1];
|
||||||
ssize_t n = readlink(filepath, target, PATH_MAX);
|
ssize_t n = readlink(filepath, target, PATH_MAX);
|
||||||
if (n != -1) {
|
if (n != -1) {
|
||||||
target[n] = '\0';
|
target[n] = '\0';
|
||||||
return abspath(target, cwd, buf);
|
return abspath(target, cwd, buf);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3436,7 +3436,14 @@ static int filterentries(char *path, char *lastname)
|
||||||
continue;
|
continue;
|
||||||
#ifndef NOMOUSE
|
#ifndef NOMOUSE
|
||||||
case KEY_MOUSE:
|
case KEY_MOUSE:
|
||||||
|
{
|
||||||
|
MEVENT event = {0};
|
||||||
|
getmouse(&event);
|
||||||
|
if (event.bstate == 0)
|
||||||
|
continue;
|
||||||
|
ungetmouse(&event);
|
||||||
goto end;
|
goto end;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
case ESC:
|
case ESC:
|
||||||
if (handle_alt_key(ch) != ERR) {
|
if (handle_alt_key(ch) != ERR) {
|
||||||
|
|
Loading…
Reference in a new issue