nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 6c450bee9458a621f8680c7604a098446810a486
parent f3fe27e6949842a31fcc9b3c9c2195ba31a1cc85
Author: Luuk van Baal <luukvbaal@gmail.com>
Date:   Sun,  9 May 2021 02:02:53 +0200

Fix adjust_cols for icons

Diffstat:
Msrc/nnn.c | 8+++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/nnn.c b/src/nnn.c @@ -5705,6 +5705,9 @@ static void statusbar(char *path) static int adjust_cols(int n) { /* Calculate the number of cols available to print entry name */ +#ifdef ICONS_ENABLED + n -= (g_state.oldcolor ? 0 : 1 + xstrlen(ICON_PADDING_LEFT) + xstrlen(ICON_PADDING_RIGHT)); +#endif if (cfg.showdetail) { /* Fallback to light mode if less than 35 columns */ if (n < 36) { @@ -5717,12 +5720,7 @@ static int adjust_cols(int n) } /* 3 = Preceding space, indicator, newline */ -#ifdef ICONS_ENABLED - return (n - (g_state.oldcolor ? 3 - : 3 + xstrlen(ICON_PADDING_LEFT) + xstrlen(ICON_PADDING_RIGHT) + 1)); -#else return (n - 3); -#endif } static void draw_line(char *path, int ncols)