Make print_help_label() preserve cursor position

Otherwise it might end up in a wrong part of the screen.

An easy way to reproduce is to press <Ctrl-D> right after launching `hh`.
This commit is contained in:
xaizek 2018-04-28 17:13:46 +03:00
parent 4e4fb4618b
commit 5c97716b13
No known key found for this signature in database
GPG key ID: 99DC5E4DB05F6BE2

View file

@ -474,10 +474,15 @@ void add_to_selection(Hstr *hstr, char *line, unsigned int *index)
void print_help_label()
{
int cursorX=getcurx(stdscr);
int cursorY=getcury(stdscr);
char screenLine[CMDLINE_LNG];
snprintf(screenLine, getmaxx(stdscr), "%s", LABEL_HELP);
mvprintw(hstr->promptYHelp, 0, "%s", screenLine); clrtoeol();
refresh();
move(cursorY, cursorX);
}
void print_confirm_delete(const char *cmd, Hstr *hstr)