MCPcopy Create free account
hub / github.com/antirez/ds4 / foldSetRenderedText

Function foldSetRenderedText

linenoise.c:1024–1035  ·  view source on GitHub ↗

Fill f->display with the text shown instead of the folded range. */

Source from the content-addressed store, hash-verified

1022 if (row > 0) row++;
1023 if (!nl) break;
1024 p = nl + 1;
1025 }
1026}
1027
1028int 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);

Callers 2

linenoiseGetRenderFoldsFunction · 0.85

Calls 1

foldCountLinesFunction · 0.85

Tested by

no test coverage detected