Skip to content

Commit

Permalink
better status bar
Browse files Browse the repository at this point in the history
  • Loading branch information
codekitchen committed Nov 24, 2019
1 parent e5a7a3e commit 2731207
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,13 @@ int show_preview(const char *a, int b) {
size_t total = 0;
last_status = read_command(rl_line_buffer, &shown, &total);
termput("mr");
int statsize = 0;
if (last_status == 0) {
printf(" %zu lines, showing %zu ", total, shown);
statsize = printf(" %zu lines, showing %zu ", total, shown);
} else {
printf(" error in command: %i ", last_status);
statsize = printf(" error in command: %i ", last_status);
}
printf("%*s", COLS - statsize, "");
termput("me");
for (int i = 0; i < (shown + 1); ++i) {
termput("up");
Expand Down

0 comments on commit 2731207

Please sign in to comment.