From ff23571608a45177928f8edfe0e88b7e3630180f Mon Sep 17 00:00:00 2001 From: OIX Date: Fri, 18 Dec 2020 15:24:58 +0100 Subject: [PATCH] fix: in browser mode, state flags were visually attached to the path when length of state string was zero (eg. when the browser was active), cursor position was calculated 1 or 3 characters behind top window's size. thus wmove() returned an error and did not change the cursor position, causing that state info was directly appended to path. the minimalistic fix is, to print the state info only, when stateflag string was initialized to a size bigger than 2. because in browser mode statelen is 2 or 0 (depending if right border spaces are included or not). --- src/winio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/winio.c b/src/winio.c index e961ccc..03a12c4 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2007,7 +2007,7 @@ void titlebar(const char *path) if (ISSET(STATEFLAGS) && !ISSET(VIEW_MODE)) { if (openfile->modified && COLS > 1) waddstr(topwin, " *"); - if (statelen < COLS) { + if (statelen > 2 && statelen < COLS) { wmove(topwin, 0, COLS + 2 - statelen); waddstr(topwin, ISSET(AUTOINDENT) ? "I" : " "); waddstr(topwin, openfile->mark ? "M" : " "); -- 2.7.4