more miscellaneous minor fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3615 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
David Lawrence Ramsey 2006-06-03 17:31:52 +00:00
parent 299ab27363
commit f70f67bd10
6 changed files with 20 additions and 17 deletions

View File

@ -135,6 +135,9 @@ CVS code -
doc/syntax/sh.nanorc, and doc/syntax/tex.nanorc; changes to doc/syntax/sh.nanorc, and doc/syntax/tex.nanorc; changes to
configure.ac, nano.spec.in, doc/Makefile.am, and configure.ac, nano.spec.in, doc/Makefile.am, and
m4/Makefile.am; removal of doc/nanorc.sample. (DLR) m4/Makefile.am; removal of doc/nanorc.sample. (DLR)
- Replace usage of the bool curses_ended with the isendwin()
function, and remove curses_ended. Changes to do_suspend().
(DLR)
- browser.c: - browser.c:
do_browser() do_browser()
- Reference NANO_GOTODIR_(ALT|F)?KEY instead of - Reference NANO_GOTODIR_(ALT|F)?KEY instead of
@ -249,6 +252,8 @@ CVS code -
(DLR, found by Benno Schulenberg) (DLR, found by Benno Schulenberg)
renumber() renumber()
- Remove invalid assert. (DLR, found by Filipe Moreira) - Remove invalid assert. (DLR, found by Filipe Moreira)
do_suspend()
- Simplify the printing of "Use \"fg\" to return to nano". (DLR)
do_input() do_input()
- Remove redundant check for allow_funcs' being TRUE when we get - Remove redundant check for allow_funcs' being TRUE when we get
KEY_MOUSE. (DLR) KEY_MOUSE. (DLR)
@ -327,6 +332,9 @@ CVS code -
statusbar message. (Benno Schulenberg) statusbar message. (Benno Schulenberg)
- Unconditionally blank the statusbar as soon as we're finished - Unconditionally blank the statusbar as soon as we're finished
getting input. (DLR, suggested by Benno Schulenberg) getting input. (DLR, suggested by Benno Schulenberg)
- utils.c:
nperror()
- Simplify. (DLR)
- winio.c: - winio.c:
parse_kbinput() parse_kbinput()
- If we get NANO_CONTROL_8, properly handle it in all cases. - If we get NANO_CONTROL_8, properly handle it in all cases.

View File

@ -208,10 +208,6 @@ regmatch_t regmatches[10];
int reverse_attr = A_REVERSE; int reverse_attr = A_REVERSE;
/* The curses attribute we use for reverse video. */ /* The curses attribute we use for reverse video. */
bool curses_ended = FALSE;
/* Whether endwin() has ended curses mode and statusbar()
* should hence write to stderr instead of displaying on the
* statusbar. */
char *homedir = NULL; char *homedir = NULL;
/* The user's home directory, from $HOME or /etc/passwd. */ /* The user's home directory, from $HOME or /etc/passwd. */

View File

@ -532,6 +532,7 @@ void finish(void)
blank_statusbar(); blank_statusbar();
wrefresh(bottomwin); wrefresh(bottomwin);
endwin(); endwin();
/* Restore the old terminal settings. */ /* Restore the old terminal settings. */
@ -555,7 +556,6 @@ void die(const char *msg, ...)
va_list ap; va_list ap;
endwin(); endwin();
curses_ended = TRUE;
/* Restore the old terminal settings. */ /* Restore the old terminal settings. */
tcsetattr(0, TCSANOW, &oldterm); tcsetattr(0, TCSANOW, &oldterm);
@ -994,8 +994,10 @@ RETSIGTYPE handle_hupterm(int signal)
/* Handler for SIGTSTP (suspend). */ /* Handler for SIGTSTP (suspend). */
RETSIGTYPE do_suspend(int signal) RETSIGTYPE do_suspend(int signal)
{ {
/* Temporarily leave curses mode. */
endwin(); endwin();
printf("\n\n\n\n\n%s\n", _("Use \"fg\" to return to nano"));
printf(_("\n\n\n\n\nUse \"fg\" to return to nano\n"));
fflush(stdout); fflush(stdout);
/* Restore the old terminal settings. */ /* Restore the old terminal settings. */

View File

@ -138,7 +138,6 @@ extern regmatch_t regmatches[10];
#endif #endif
extern int reverse_attr; extern int reverse_attr;
extern bool curses_ended;
extern char *homedir; extern char *homedir;

View File

@ -355,17 +355,15 @@ const char *strstrwrapper(const char *haystack, const char *needle,
return mbstrcasestr(start, needle); return mbstrcasestr(start, needle);
} }
/* This is a wrapper for the perror() function. The wrapper takes care /* This is a wrapper for the perror() function. The wrapper temporarily
* of curses, calls perror() (which writes to stderr), and then * leaves curses mode, calls perror() (which writes to stderr), and then
* refreshes the screen. Note that nperror() causes the window to * reenters curses mode, updating the screen in the process. Note that
* flicker once. */ * nperror() causes the window to flicker once. */
void nperror(const char *s) void nperror(const char *s)
{ {
/* Leave curses mode and go to the terminal. */ endwin();
if (endwin() != ERR) { perror(s);
perror(s); /* Print the error. */ doupdate();
total_refresh(); /* Return to curses and refresh. */
}
} }
/* This is a wrapper for the malloc() function that properly handles /* This is a wrapper for the malloc() function that properly handles

View File

@ -2119,7 +2119,7 @@ void statusbar(const char *msg, ...)
/* Curses mode is turned off. If we use wmove() now, it will muck /* Curses mode is turned off. If we use wmove() now, it will muck
* up the terminal settings. So we just use vfprintf(). */ * up the terminal settings. So we just use vfprintf(). */
if (curses_ended) { if (isendwin()) {
vfprintf(stderr, msg, ap); vfprintf(stderr, msg, ap);
va_end(ap); va_end(ap);
return; return;