pinosaur
/
smdp.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
2854a2e
)
added hint to terminal geometry error as suggested in #15
author
Michael Göhler
<somebody.here@gmx.de>
Fri, 19 Sep 2014 21:29:55 +0000
(23:29 +0200)
committer
Michael Göhler
<somebody.here@gmx.de>
Fri, 19 Sep 2014 21:29:55 +0000
(23:29 +0200)
viewer.c
patch
|
blob
|
history
diff --git
a/viewer.c
b/viewer.c
index
6db88b9
..
e31dbcb
100644
(file)
--- a/
viewer.c
+++ b/
viewer.c
@@
-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)) {
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);
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);
}
return(1);
}