Fill f->display with the text shown instead of the folded range. */
| 1022 | if (row > 0) row++; |
| 1023 | if (!nl) break; |
| 1024 | p = nl + 1; |
| 1025 | } |
| 1026 | } |
| 1027 | |
| 1028 | int linenoiseRefreshStatus(struct linenoiseState *l) { |
| 1029 | if (!l->oldrows || l->screen_cursor_row <= 0 || l->screen_cursor_col <= 0 || |
| 1030 | l->oldstatusrows != (size_t)linenoiseStatusRows(l)) return 0; |
| 1031 | char seq[64]; |
| 1032 | struct abuf ab; |
| 1033 | abInit(&ab); |
| 1034 | int last_input_row = l->screen_cursor_row - l->oldrpos + (int)l->oldrows; |
| 1035 | int n = snprintf(seq, sizeof(seq), "\x1b[0m\x1b[%d;1H", last_input_row); |
| 1036 | abAppend(&ab, seq, n); |
| 1037 | refreshStatusLine(&ab, l, last_input_row + 1); |
| 1038 | n = snprintf(seq, sizeof(seq), "\x1b[0m\x1b[%d;%dH", l->screen_cursor_row, l->screen_cursor_col); |
no test coverage detected