Fix for resizing the window in modes other than normal edit mode Changes to handle_sigwinch(), main(). Fixes bug #52 (Rocco)

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@509 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Chris Allegretta 2001-01-29 23:37:54 +00:00
parent e434b45148
commit 08020889d3
4 changed files with 29 additions and 11 deletions

15
BUGS
View File

@ -1,3 +1,6 @@
- Marked cutting sometimes leaves a newline in the file unintelligently,
such as when all of a line is selected but the mark doesn't proceed to
the new line. (8) [FIXED/IRRELEVANT]
- Certains are not lined up properly when there are tabs in them at
certain col values. (9) [FIXED]
- edit_refresh() and update_line() do not handle selecting text when the
@ -49,6 +52,7 @@
[FIXED]
- Using nano -t, user can not exit until a filename is given via ^O. (30)
[FIXED]
- totsize problems still abound in do_justify (33) [FIXED]
- Using -k cut text is not pasted properly. (34) [FIXED].
- Using -k pasted text is not updated properly if it goes beyond editbot. (35)
[FIXED]
@ -85,17 +89,12 @@
current line to the top of the screen, which it shouldn't do. (50)
[FIXED]
- with PDCURSES, running meta-X turns off the keypad. (51) [FIXED]
- Resizing the window completely screws up the display if in any other
mode than normal editing (help screen, search and replace, file
browser..) (52) [FIXED]
- Alt speller argument (-s, --speller) does not take a string argument of
more than one word. (53) [FIXED].
- totsize problems still abound in do_justify (33) [FIXED]
- Marked cutting sometimes leaves a newline in the file unintelligently,
such as when all of a line is selected but the mark doesn't proceed to
the new line. (8) [FIXED/IRRELEVANT]
** Open BUGS **
- Resizing the window completely screws up the display if in any other
mode than normal editing (help screen, search and replace, file
browser..) (52)
$Id$

View File

@ -5,6 +5,8 @@ General
easily replaced with COLS / 2 (oops, not current_x & y (Rob)).
- Deleted free_node, duplicate of delete_node, and changed all
free_node calls to delete_node.
- Fix for resizing the window in modes other than normal edit mode
Changes to handle_sigwinch(), main(). Fixes bug #52 (Rocco).
- files.c:
write_file()
- Don't free() realname on error, if it needs to be free()d later

20
nano.c
View File

@ -23,6 +23,7 @@
#include <stdlib.h>
#include <stdarg.h>
#include <signal.h>
#include <setjmp.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
@ -78,6 +79,8 @@ char *last_search = NULL; /* Last string we searched for */
char *last_replace = NULL; /* Last replacement string */
int search_last_line; /* Is this the last search line? */
static sigjmp_buf jmpbuf; /* Used to return to mainloop after SIGWINCH */
/* What we do when we're all set to exit */
RETSIGTYPE finish(int sigage)
{
@ -1610,7 +1613,12 @@ void handle_sigwinch(int s)
titlebar(NULL);
edit_refresh();
display_main_list();
blank_statusbar();
total_refresh();
/* Jump back to mainloop */
siglongjmp(jmpbuf, 1);
#endif
}
@ -2089,8 +2097,8 @@ int main(int argc, char *argv[])
int optchr;
int kbinput; /* Input from keyboard */
long startline = 0; /* Line to try and start at */
int keyhandled = 0; /* Have we handled the keystroke yet? */
int i, modify_control_seq = 0;
int keyhandled; /* Have we handled the keystroke yet? */
int i, modify_control_seq;
char *argv0;
#ifdef _POSIX_VDISABLE
struct termios term;
@ -2304,6 +2312,14 @@ int main(int argc, char *argv[])
else
edit_update(fileage, CENTER);
/* return here after a sigwinch */
sigsetjmp(jmpbuf,1);
/* Fix clobber-age */
kbinput = 0;
keyhandled = 0;
modify_control_seq = 0;
edit_refresh();
reset_cursor();

View File

@ -141,7 +141,7 @@ void do_replace_highlight(int highlight_flag, char *word);
void nano_disabled_msg(void);
void window_init(void);
#ifdef NANO_EXTRA
void do_credits(void);
void do_credits(int junk);
#endif
int do_writeout_void(void), do_exit(void), do_gotoline_void(void);
@ -160,6 +160,7 @@ struct stat filestat(const char *path);
char *do_browse_from(char *inpath);
#endif
RETSIGTYPE main_loop (int junk);
filestruct *copy_node(filestruct * src);
filestruct *copy_filestruct(filestruct * src);