Skip to content

Commit

Permalink
Don't move the cursor upwards if no choices where printed
Browse files Browse the repository at this point in the history
Fixes #98 and #196.
  • Loading branch information
mptre committed Jun 26, 2017
1 parent 84410ec commit ecdca3d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pick.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,11 @@ selected_choice(void)
err(1, "tty_putc");
tty_putp(clr_eos, 1);
tty_putp(tparm(parm_up_cursor, choices_count + 1), 1);
} else {
} else if (choices_count > 0) {
/*
* parm_up_cursor interprets 0 as 1, therefore only move
* upwards if any choices where printed.
*/
tty_putp(tparm(parm_up_cursor,
choices_count < choices_lines
? choices_count : choices_lines), 1);
Expand Down

0 comments on commit ecdca3d

Please sign in to comment.