mirror of
https://github.com/dvorka/hstr.git
synced 2025-09-11 23:14:16 +08:00
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:
parent
4e4fb4618b
commit
5c97716b13
1 changed files with 5 additions and 0 deletions
|
@ -474,10 +474,15 @@ void add_to_selection(Hstr *hstr, char *line, unsigned int *index)
|
||||||
|
|
||||||
void print_help_label()
|
void print_help_label()
|
||||||
{
|
{
|
||||||
|
int cursorX=getcurx(stdscr);
|
||||||
|
int cursorY=getcury(stdscr);
|
||||||
|
|
||||||
char screenLine[CMDLINE_LNG];
|
char screenLine[CMDLINE_LNG];
|
||||||
snprintf(screenLine, getmaxx(stdscr), "%s", LABEL_HELP);
|
snprintf(screenLine, getmaxx(stdscr), "%s", LABEL_HELP);
|
||||||
mvprintw(hstr->promptYHelp, 0, "%s", screenLine); clrtoeol();
|
mvprintw(hstr->promptYHelp, 0, "%s", screenLine); clrtoeol();
|
||||||
refresh();
|
refresh();
|
||||||
|
|
||||||
|
move(cursorY, cursorX);
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_confirm_delete(const char *cmd, Hstr *hstr)
|
void print_confirm_delete(const char *cmd, Hstr *hstr)
|
||||||
|
|
Loading…
Add table
Reference in a new issue