diff --git a/ChangeLog b/ChangeLog index 95061b7ad657222a695951079f87bf742a653c40..89db5d74b51ae1dd8cacea67b0c2284484fcea0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-03-07 Chris Allegretta <chrisa@asty.org> + * configure.ac, nano.c (handle_sigwinch): Create check for whether LINES and + COLS can safely be redefined. Fixes compilation issues with cygwin, and likely + with newer versions of ncurses, fixes Savannah bug 28984 repoted by Andy Koppe + and Eric Oliver via mailing list. + * winio.c (get_mouseinput) - fix stray semicolon in code, also reported in + bug 28984. + GNU nano 2.2.3 - 2010.02.11 2010-01-28 Chris Allegretta <chrisa@asty.org> * move.c (do_page_up, do_page_down): Fix for smooth mode not preserving cusor diff --git a/configure.ac b/configure.ac index 7f60a9b922b61c187738b0c6700a8566e00694cb..2dcb5bca08bc33cb75fc1cb0c7c6abe355aed3b6 100644 --- a/configure.ac +++ b/configure.ac @@ -569,6 +569,21 @@ int main(void) fi #fi +AC_MSG_CHECKING([whether LINES and COLS can be redefined]) +AC_TRY_RUN([ +#include <curses.h> +int main(void) +{ + LINES = 80; + COLS = 25; + return 0; +}], +AC_DEFINE(REDEFINIG_MACROS_OK, 1, [Define this if you know your curses library allows LINES and COLS to be redefined to deal with a resizing bug]) +AC_MSG_RESULT(yes), +AC_MSG_RESULT(no), +AC_MSG_WARN([*** Can't check for macro redefinability when cross-compiling])) + + # Check for groff html support AC_MSG_CHECKING([for HTML support in groff]) groff -t -mandoc -Thtml </dev/null >/dev/null diff --git a/src/nano.c b/src/nano.c index 3e0854867bc92271e596ff0391a4c10c426a15c4..a6abd26d0c2bdd23824cc67878e9cbebc83771f5 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1263,8 +1263,10 @@ RETSIGTYPE handle_sigwinch(int signal) * otherwise. However, COLS and LINES are curses global variables, * and in some cases curses has already updated them. But not in * all cases. Argh. */ +#ifdef REDEFINIG_MACROS_OK COLS = win.ws_col; LINES = win.ws_row; +#endif /* If we've partitioned the filestruct, unpartition it now. */ if (filepart != NULL) diff --git a/src/winio.c b/src/winio.c index 05e149601f086fd7b97cc4c9f5da0e0db7f98a47..918c04920caabf3e26b1b7d60a7a813e9ccdf502 100644 --- a/src/winio.c +++ b/src/winio.c @@ -1746,7 +1746,7 @@ int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts) * wheel is equivalent to moving down three lines. */ for (i = 0; i < 3; i++) unget_kbinput((mevent.bstate & BUTTON4_PRESSED) ? - sc_seq_or(do_up_void, 0) : sc_seq_or(DO_DOWN_VOID, 0);, FALSE, + sc_seq_or(DO_UP_VOID, 0) : sc_seq_or(DO_DOWN_VOID, 0), FALSE, FALSE); return 1;