]> Sergey Matveev's repositories - nnn.git/commitdiff
We don't want to exit the typing mode because of an error
authorlostd <lostd@2f30.org>
Thu, 2 Jul 2015 21:51:58 +0000 (22:51 +0100)
committerlostd <lostd@2f30.org>
Thu, 2 Jul 2015 21:51:58 +0000 (22:51 +0100)
Delay displaying the message until return is pressed.
Also contain all printwarn() calls inside browse().

noice.c

diff --git a/noice.c b/noice.c
index 8fe094364523267e29b8c6e531b5761cbedfaa65..2c408fe10488b07f4fc0c1d0e6134c1d261aa87b 100644 (file)
--- a/noice.c
+++ b/noice.c
@@ -578,10 +578,8 @@ populate(void)
        int r;
 
        /* Can fail when permissions change while browsing */
-       if (canopendir(path) == 0) {
-               printwarn();
+       if (canopendir(path) == 0)
                return -1;
-       }
 
        /* Search filter */
        r = setfilter(&re, fltr);
@@ -666,8 +664,10 @@ begin:
        /* Path and filter should be malloc(3)-ed strings at all times */
        r = populate();
        if (r == -1) {
-               nowtyping = 0;
-               goto nochange;
+               if (!nowtyping) {
+                       printwarn();
+                       goto nochange;
+               }
        }
 
        for (;;) {