mirror of
https://github.com/jarun/nnn.git
synced 2025-03-12 17:54:04 +00:00
Fix #1213: scroll long strings in prompts
This commit is contained in:
parent
aa8baa3d91
commit
8efcc24e0e
1 changed files with 7 additions and 2 deletions
|
@ -3485,8 +3485,13 @@ static char *xreadline(const char *prefill, const char *prompt)
|
|||
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);
|
||||
|
|
Loading…
Add table
Reference in a new issue