Skip to content

Commit 15c27ce

Browse files
committed
ucode-mod-uline: fix prompt after set_hint with string bigger than the window size
Redraw the prompt after the hint instead of trying to move backwards Signed-off-by: Felix Fietkau <[email protected]>
1 parent 06c6481 commit 15c27ce

File tree

1 file changed

+8
-1
lines changed
  • package/utils/ucode-mod-uline/src

1 file changed

+8
-1
lines changed

package/utils/ucode-mod-uline/src/uline.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,14 @@ void uline_set_hint(struct uline_state *s, const char *str, size_t len)
880880
pos_add_string(s, &s->cursor_pos, str, len);
881881
}
882882

883-
set_cursor(s, prev_pos);
883+
if (s->cursor_pos.y >= s->rows) {
884+
if (s->cursor_pos.x > 0)
885+
vt100_next_line(s->output);
886+
s->cursor_pos = (struct pos){};
887+
s->full_update = true;
888+
} else {
889+
set_cursor(s, prev_pos);
890+
}
884891
fflush(s->output);
885892
}
886893

0 commit comments

Comments
 (0)