diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2020-04-20 14:20:46 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2020-04-20 14:20:46 -0700 |
| commit | 69bc783ff9ebc2344dab14ef7bd140c87d31733b (patch) | |
| tree | 86634479e7c3959a58e3987780564acce51e7e32 /bb.c | |
| parent | 8eedc8b72620d8dc69da9296d79569375a1da5ba (diff) | |
Slightly optimized column rendering by using the sequence for moving
column position instead of row,col
Diffstat (limited to 'bb.c')
| -rw-r--r-- | bb.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -784,7 +784,7 @@ void render(bb_t *bb) if (!col.name) continue; const char *title = col.name; if (!title) title = ""; - move_cursor(tty_out, x, 1); + move_cursor_col(tty_out, x); if (c > 0) { fputs("┃\033[K", tty_out); x += 1; @@ -792,7 +792,7 @@ void render(bb_t *bb) const char *indicator = " "; if (bb->columns[c] == bb->sort[1]) indicator = bb->sort[0] == '-' ? RSORT_INDICATOR : SORT_INDICATOR; - move_cursor(tty_out, x, 1); + move_cursor_col(tty_out, x); fputs(indicator, tty_out); fputs(title, tty_out); x += colwidths[c]; @@ -816,10 +816,11 @@ void render(bb_t *bb) CURSOR_COLOR : color_of(entry->info.st_mode); fputs(color, tty_out); int x = 0, y = i - bb->scroll + 2; + move_cursor(tty_out, x, y); for (int c = 0; bb->columns[c]; c++) { column_t col = columns[(int)bb->columns[c]]; if (!col.name) continue; - move_cursor(tty_out, x, y); + move_cursor_col(tty_out, x); if (c > 0) { // Separator | if (i == bb->cursor) fprintf(tty_out, "\033[2m┃\033[22m"); else fprintf(tty_out, "\033[37;2m┃\033[22m%s", color); |
