Skip to content

Commit

Permalink
Fix clearing of the status window
Browse files Browse the repository at this point in the history
Leaving a prompt with Ctrl-C was leaving artifacts such as ":^" on
the screen. Fix report_clear to pass an empty string and use that
to detect whether to call wclear.

Possible fix for jonas#623.
  • Loading branch information
jonas committed Jul 4, 2017
1 parent 9c9a217 commit 2b384f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/tig/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extern WINDOW *status_win;

void update_status(const char *msg, ...);
void report(const char *msg, ...) PRINTF_LIKE(1, 2);
#define report_clear() report("%s", "")
#define report_clear() report("")

/*
* Display management.
Expand Down
6 changes: 5 additions & 1 deletion src/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,17 @@ update_status_window(struct view *view, const char *msg, va_list args)
return false;

if (!status_empty || *msg) {
bool clear = view && view->has_scrolled && use_scroll_status_wclear;

wmove(status_win, 0, 0);
if (view && view->has_scrolled && use_scroll_status_wclear)
if (clear)
wclear(status_win);
if (*msg) {
vwprintw(status_win, msg, args);
status_empty = false;
} else {
if (!clear && !status_empty)
wclear(status_win);
status_empty = true;
}
wclrtoeol(status_win);
Expand Down

0 comments on commit 2b384f6

Please sign in to comment.