when to not run the winch handles, static resizepending
is set, handler in main to run handle_sigwinch() when set.
Should fix segfaults when nano is initially suspended while
- reading in a file.
- *** FIXME: WHo t credit fo finding this bug?
+ reading in a file (found by Mike Frysinger).
- nano.c:
+ handle_sigwinch()
+ - Rework so that nano properly redraws the screen on systems
+ that don't have resizeterm() and/or wresize(). In curses, we
+ now leave and immediately reenter curses mode via endwin() and
+ refresh(), and then reinitialize all windows via
+ window_init(). In slang, the above routine will only work if
+ the resize made the window smaller, so we now leave and
+ immediately reenter screen management mode via
+ SLsmg_reset_smg() and SLsmg_init_smg(), and then reinitialize
+ all windows via window_init(). (DLR, adapted from code in
+ Minimum Profit 3.3.0 and mutt 1.4.2.1, respectively)
main()
- Don't call open_file with quiet flag set. Fixes Debian bug
#246956 (no warning when trying to open non-readable file).
- Add an extra titlebar() call (useful when reading in a big
file).
+- configure.ac:
+ - Remove the checks for resizeterm() and wresize(), as they're
+ no longer needed. (DLR)
- config.rpath:
- Replace usage of egrep with grep -E, avoiding a XSI:ism (David
Weinehall)
AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1, [Define this if your curses library has the use_default_colors command.]))
if test x$slang_support != xyes; then
- AC_CHECK_LIB([$CURSES_LIB_NAME], wresize, AC_DEFINE(HAVE_WRESIZE, 1, [Define this if you have the wresize function in your ncurses-type library.]))
- AC_CHECK_LIB([$CURSES_LIB_NAME], resizeterm, AC_DEFINE(HAVE_RESIZETERM, 1, [Define this if you have the resizeterm function in your ncurses-type library.]))
-
# Taken from aumix (can't tell from the variable name?)
AC_CACHE_CHECK([for private member _use_keypad in WINDOW],
aumix_cv_struct_window_usekeypad,
memset(hblank, ' ', COLS);
hblank[COLS] = '\0';
-#ifdef HAVE_RESIZETERM
- resizeterm(LINES, COLS);
-#ifdef HAVE_WRESIZE
- if (wresize(topwin, 2, COLS) == ERR)
- die(_("Cannot resize top win"));
- if (mvwin(topwin, 0, 0) == ERR)
- die(_("Cannot move top win"));
- if (wresize(edit, editwinrows, COLS) == ERR)
- die(_("Cannot resize edit win"));
- if (mvwin(edit, 2, 0) == ERR)
- die(_("Cannot move edit win"));
- if (wresize(bottomwin, 3 - no_help(), COLS) == ERR)
- die(_("Cannot resize bottom win"));
- if (mvwin(bottomwin, LINES - 3 + no_help(), 0) == ERR)
- die(_("Cannot move bottom win"));
-#endif /* HAVE_WRESIZE */
-#endif /* HAVE_RESIZETERM */
+#ifdef USE_SLANG
+ /* Slang curses emulation brain damage: If we just do what curses
+ * does here, it'll only work properly if the resize made the
+ * window smaller. Do what mutt does: Leave and immediately reenter
+ * Slang screen management mode. */
+ SLsmg_reset_smg();
+ SLsmg_init_smg();
+#else
+ /* Do the equivalent of what Minimum Profit does: Leave and
+ * immediately reenter curses mode. */
+ endwin();
+ refresh();
+#endif
+
+ /* Do the equivalent of what both mutt and Minimum Profit do:
+ * Reinitialize all the windows based on the new screen
+ * dimensions. */
+ window_init();
fix_editbot();