From 315132b3633459f0bccf47dd9e671fde37463184 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Mon, 13 Apr 2020 08:32:32 +0530 Subject: Happy Birthday nnn! 🍰 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nnn.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/nnn.c b/src/nnn.c index b9cc70c..8f21134 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -107,7 +107,7 @@ #include "dbg.h" /* Macro definitions */ -#define VERSION "3.0" +#define VERSION "3.1" #define GENERAL_INFO "BSD 2-Clause\nhttps://github.com/jarun/nnn" #define SESSIONS_VERSION 1 @@ -770,7 +770,7 @@ static void clear_hash() static void clearinfoln(void) { move(xlines - 2, 0); - addch('\n'); + clrtoeol(); } #ifdef KEY_RESIZE @@ -819,12 +819,6 @@ static void printerr(int linenum) exit(1); } -static void printinfoln(const char *str) -{ - clearinfoln(); - mvaddstr(xlines - 2, xcols - strlen(str), str); -} - static inline bool xconfirm(int c) { return (c == 'y' || c == 'Y'); @@ -936,7 +930,7 @@ static void *xrealloc(void *pcur, size_t len) * Always null ('\0') terminates if both src and dest are valid pointers. * Returns the number of bytes copied including terminating null byte. */ -static size_t xstrsncpy(char *restrict dest, const char *restrict src, size_t n) +static size_t xstrsncpy(char *dest, const char *src, size_t n) { if (!src || !dest || !n) return 0; @@ -2390,13 +2384,17 @@ static void showfilterinfo(void) snprintf(info + i, REGEX_MAX - i - 1, " %s [/], %s [:]", (cfg.regex ? "regex" : "str"), ((fnstrstr == &strcasestr) ? "ic" : "noic")); - printinfoln(info); + + clearinfoln(); + mvaddstr(xlines - 2, xcols - strlen(info), info); } static void showfilter(char *str) { + attron(COLOR_PAIR(cfg.curctx + 1)); showfilterinfo(); printmsg(str); + // printmsg calls attroff() } static inline void swap_ent(int id1, int id2) -- cgit v1.2.3-70-g09d2