diff --git a/Makefile b/Makefile index 0b8894c..d875510 100644 --- a/Makefile +++ b/Makefile @@ -135,7 +135,7 @@ bind.o: bind.c bind.h estruct.h bindable.h buffer.h crypt.h line.h utf8.h \ buffer.o: buffer.c buffer.h crypt.h line.h utf8.h defines.h display.h \ estruct.h file.h retcode.h input.h bind.h window.h crypt.o: crypt.c crypt.h -display.o: display.c display.h buffer.h crypt.h line.h utf8.h estruct.h \ +display.o: display.c display.h estruct.h buffer.h crypt.h line.h utf8.h \ input.h bind.h termio.h terminal.h defines.h retcode.h version.h \ wrapper.h window.h ebind.o: ebind.c ebind.h basic.h bind.h estruct.h bindable.h buffer.h \ @@ -168,8 +168,8 @@ main.o: main.c estruct.h basic.h bind.h bindable.h buffer.h crypt.h \ log.h random.h search.h terminal.h defines.h termio.h version.h window.h mingw32.o: mingw32.c names.o: names.c names.h basic.h bind.h bindable.h buffer.h crypt.h \ - line.h utf8.h display.h eval.h exec.h retcode.h file.h isearch.h \ - region.h random.h search.h spawn.h window.h defines.h word.h + line.h utf8.h display.h estruct.h eval.h exec.h retcode.h file.h \ + isearch.h region.h random.h search.h spawn.h window.h defines.h word.h pklock.o: pklock.c estruct.h pklock.h posix.o: posix.c random.o: random.c random.h basic.h buffer.h crypt.h line.h utf8.h \ diff --git a/display.c b/display.c index 99e8946..f7c1cd0 100644 --- a/display.c +++ b/display.c @@ -1550,9 +1550,9 @@ void sizesignal(int signr) getscreensize(&w, &h); - if( h && w) { - term.t_mrow = h ; - term.t_mcol = w ; + if( h > 0 && w > 0) { + term.t_mrow = h = h < MAXROW ? h : MAXROW ; + term.t_mcol = w = w < MAXCOL ? w : MAXCOL ; if( h - 1 != term.t_nrow || w != term.t_ncol) newscreensize( h, w) ; } diff --git a/display.h b/display.h index 84ab229..9b47065 100644 --- a/display.h +++ b/display.h @@ -1,6 +1,8 @@ #ifndef _DISPLAY_H_ #define _DISPLAY_H_ +#include "estruct.h" + extern int mpresf ; /* Stuff in message line */ extern int scrollcount ; /* number of lines to scroll */ extern int discmd ; /* display command flag */ @@ -25,8 +27,13 @@ void mlforce( char *s) ; void mlputs( char *s) ; void getscreensize( int *widthp, int *heightp) ; +#if UNIX +#include #ifdef SIGWINCH +extern int chg_width, chg_height ; + void sizesignal( int signr) ; #endif +#endif #endif diff --git a/spawn.c b/spawn.c index 990ab78..172f134 100644 --- a/spawn.c +++ b/spawn.c @@ -42,8 +42,6 @@ extern short iochan; /* In "termio.c" */ #if V7 | USG | BSD #include #ifdef SIGWINCH -extern int chg_width, chg_height; -extern void sizesignal(int); #endif #endif diff --git a/tcap.c b/tcap.c index 3b62c30..07434d5 100644 --- a/tcap.c +++ b/tcap.c @@ -161,8 +161,9 @@ static void tcapopen(void) exit(1); } #ifdef SIGWINCH - term.t_mrow = int_row > MAXROW ? MAXROW : int_row ; - term.t_mcol = int_col > MAXCOL ? MAXCOL : int_col ; +/* At initialization we use maximum size even if current OS window is smaller */ + term.t_mrow = MAXROW ; + term.t_mcol = MAXCOL ; #else term.t_mrow = term.t_nrow > MAXROW ? MAXROW : term.t_nrow; term.t_mcol = term.t_ncol > MAXCOL ? MAXCOL : term.t_ncol;