Skip to content

Commit

Permalink
added hint to terminal geometry error as suggested in #15
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Göhler committed Sep 19, 2014
1 parent 2854a2e commit 68ae3bc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion viewer.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,19 @@ int ncurses_display(deck_t *deck, int notrans, int nofade, int invert) {
if((max_cols > COLS) ||
(max_lines + bar_top + bar_bottom + 2 > LINES)) {

// disable ncurses
endwin();

// print error
fprintf(stderr, "Error: Terminal size %ix%i too small. Need at least %ix%i.\n",
COLS, LINES, max_cols, max_lines + bar_top + bar_bottom + 2);
endwin();

// print hint to solve it
if(max_lines + bar_top + bar_bottom + 2 > LINES)
fprintf(stderr, "You may need to add additional horizontal rules ('***') to split your file in shorter slides.\n");
if(max_cols > COLS)
fprintf(stderr, "Automatic line wrapping is not supported jet. You may need to shorten some lines by inserting line breaks.\n");

return(1);
}

Expand Down

0 comments on commit 68ae3bc

Please sign in to comment.