Skip to content

Commit

Permalink
ui/ncurses: Clear remaining space when drawing help line
Browse files Browse the repository at this point in the history
When drawing the screen's help line clear each character after the new
help line to avoid stale parts of the previous screen's help line
remaining on the screen.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
  • Loading branch information
sammj committed Feb 12, 2018
1 parent 02af1ca commit 11c4350
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/ncurses/nc-scr.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int nc_scr_unpost(struct nc_scr *scr)

void nc_scr_frame_draw(struct nc_scr *scr)
{
int ltitle_len, rtitle_len;
int ltitle_len, rtitle_len, help_len;

DBGS("ltitle '%s'\n", scr->frame.ltitle);
DBGS("rtitle '%s'\n", scr->frame.rtitle);
Expand All @@ -77,6 +77,10 @@ void nc_scr_frame_draw(struct nc_scr *scr)

mvwhline(scr->main_ncw, LINES - nc_scr_pos_help_sep, 1, ACS_HLINE,
COLS - 2);
help_len = 1 + strlen(scr->frame.help);
if (help_len < COLS)
mvwhline(scr->main_ncw, LINES - nc_scr_pos_help, help_len, ' ',
COLS - help_len);
mvwaddstr(scr->main_ncw, LINES - nc_scr_pos_help, 1, scr->frame.help);
nc_scr_status_draw(scr);
}
Expand Down

0 comments on commit 11c4350

Please sign in to comment.