-
-
Notifications
You must be signed in to change notification settings - Fork 769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NNN command line forward slash filter command won't allow other commands #1765
Comments
You can't run commands in the filter prompt. |
I think the issue he's describing is different. If you click on the statusbar with the mouse then pretty much all other keybindings stop working. I was able to reproduce it on my end. But haven't yet looked into what's causing it. |
I see. It's been ages I have used the mouse with nnn. Reopened. |
even |
It does, but the visual doesn't update. And sometimes clicking on the statusbar doesn't even enable filter mode. And sometimes it shows filter mode being activated but it actually isn't. Something seems to be going pretty wrong somewhere. |
By trying to reproduce the issue, I came across the following behaviour:
|
Do you use the program option |
As per the wiki mouse options:
|
No, I don't. I didn't even know about |
Git bisect shows 2ac22cf to be the commit that introduced the issue. Not really sure what's going on tbh, the mouse handling code seems pretty complicated. |
@N-R-K The intended behaviour is: if type-to-nav mode is on, single or double click on the last 2 rows should disable it and vice versa. I don't see anything mentioned about just the filter being on or off. Maybe we can toggle that also but in that case the filter should not show when disabled. |
oh this happening to me too; commented out so much still couldn't get rid of it; now i know why, silly mouse ... what a relief commented out clicking last 2 lines ... |
Did a bit more debugging on this. In here, it receives another Lines 3387 to 3389 in e76d7bb
log:
@jarun can we just remove this feature? It's been broken for ~4 years and almost no one noticed - meaning no one actually uses it. |
Actually I use it on my smartphone and the touch works there! :) Can you please check if just single/double click works? That is - whether commenting out any of the below snippets work: 7001 /* Toggle filter mode on left click on last 2 lines */
7002 if (event.y >= xlines - 2 && event.bstate == BUTTON1_PRESSED) {
7003 clearfilter();
7004 cfg.filtermode ^= 1;
7005 if (cfg.filtermode) {
7006 presel = FILTER;
7007 goto nochange;
7008 }
7009
7010 /* Start watching the directory */
7011 watch = TRUE;
7012 copycurname();
7013 cd = FALSE;
7014 goto begin;
7015 } OR 7057 } else {
7058 if (cfg.filtermode || filterset())
7059 presel = FILTER;
7060 copycurname();
7061 goto nochange;
7062 } |
@N-R-K and others, can you please check if the following patch works? (Ignore the changes due to trailing spaces). diff --git a/src/nnn.c b/src/nnn.c
index d0938b99..dc3d7cf2 100644
--- a/src/nnn.c
+++ b/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 */
-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;
}
@@ -3436,6 +3436,11 @@ 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: |
Appears to be fixed for good in my tests. @N-R-K @luukvbaal would it be possible to add a check in Makefile or PR CI to detect trailing blank spaces? |
Environment details (Put
x
in the checkbox along with the information)nnn
masterExact steps to reproduce the issue
When I click on the command line in nnn it displays only a forward slash filter character to the left and on the line above to the right the characters str [/}, ic [:] or noic [:]. It does not allow me to use any other character besides / including the colon : to do other non-filter commands.
The text was updated successfully, but these errors were encountered: