src/nnn.c | 16 ++++++++++------ diff --git a/src/nnn.c b/src/nnn.c index 167a5644753d99b4a4eaa749e6d5b22ed7ad0fa7..2a432b5a0ee0e66897cb9ed2ae548086984124ac 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -4734,7 +4734,7 @@ last_curscroll = -1; } #ifndef NOFIFO -static void notify_fifo() +static void notify_fifo(bool force) { if (fifofd == -1) { fifofd = open(fifopath, O_WRONLY|O_NONBLOCK|O_CLOEXEC); @@ -4749,7 +4749,7 @@ } static struct entry lastentry; - if (!memcmp(&lastentry, &dents[cur], sizeof(struct entry))) + if (!force && !memcmp(&lastentry, &dents[cur], sizeof(struct entry))) return; lastentry = dents[cur]; @@ -4796,7 +4796,7 @@ curscroll = MAX(curscroll, MAX(cur - (onscreen - 1), 0)); #ifndef NOFIFO if (fifopath) - notify_fifo(); + notify_fifo(FALSE); #endif } @@ -5471,8 +5471,12 @@ if (event.y >= 2 && event.y <= ndents + 1 && (event.bstate == BUTTON1_PRESSED || event.bstate == BUTTON3_PRESSED)) { r = curscroll + (event.y - 2); - move_cursor(r, 1); - + if (r != cur) + move_cursor(r, 1); +#ifndef NOFIFO + else + notify_fifo(TRUE); +#endif /* Handle right click selection */ if (event.bstate == BUTTON3_PRESSED) { rightclicksel = 1; @@ -7341,7 +7345,7 @@ haiku_close_nm(haiku_hnd); #endif #ifndef NOFIFO - notify_fifo(); + notify_fifo(FALSE); if (fifofd != -1) close(fifofd); #endif