src/nnn.c | 9 +++++++-- diff --git a/src/nnn.c b/src/nnn.c index 40e258f4483366c86b41393043bdf953674d5427..aea0b6936e74715302e7d924af0597a0ae37d467 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -3485,8 +3485,13 @@ while (1) { buf[len] = ' '; attron(COLOR_PAIR(cfg.curctx + 1)); - mvaddnwstr(xlines - 1, x, buf, len + 1); - move(xlines - 1, x + wcswidth(buf, pos)); + if (pos > (size_t)(xcols - x)) { + mvaddnwstr(xlines - 1, x, buf + (pos - (xcols - x)), xcols - x); + move(xlines - 1, xcols - 1); + } else { + mvaddnwstr(xlines - 1, x, buf, len + 1); + move(xlines - 1, x + wcswidth(buf, pos)); + } attroff(COLOR_PAIR(cfg.curctx + 1)); r = get_wch(ch);