From: lostd Date: Thu, 2 Jul 2015 21:51:58 +0000 (+0100) Subject: We don't want to exit the typing mode because of an error X-Git-Tag: v1.0~92^2~56 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=4db0d0dae08090f1bdf7b9a629777ba09e222667;p=nnn.git We don't want to exit the typing mode because of an error Delay displaying the message until return is pressed. Also contain all printwarn() calls inside browse(). --- diff --git a/noice.c b/noice.c index 8fe09436..2c408fe1 100644 --- 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 (;;) {