CVS code -
- General:
- Translation updates (see po/ChangeLog for details).
+ - Remove malloc.h, as it's unneeded and just causes annoyances on
+ *BSD systems. Added stdlib.h to global.c
+ - Added Meta-Y toggle to disable/enable color syntax highlighting
+ completely. This may eventually be per-buffer, but that's too
+ complicated for a feature freeze.
GNU nano 1.1.11 - 10/01/2002
- General:
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h unistd.h malloc.h termios.h termio.h limits.h getopt.h regex.h)
+AC_CHECK_HEADERS(fcntl.h unistd.h termios.h termio.h limits.h getopt.h regex.h)
dnl options
AC_ARG_ENABLE(debug,
#include "config.h"
+#include <stdlib.h>
#include <assert.h>
#include <sys/stat.h>
#include "proto.h"
#ifdef ENABLE_MULTIBUFFER
char *toggle_load_msg;
#endif
+#ifdef ENABLE_COLOR
+ char *toggle_syntax_msg;
+#endif
/* There is no need to reinitialize the toggles. They can't
change. In fact, reinitializing them causes a segfault in
toggle_mac_msg = _("Writing file in Mac format");
toggle_backup_msg = _("Backing up file");
toggle_smooth_msg = _("Smooth scrolling");
+#ifdef ENABLE_COLOR
+ toggle_syntax_msg = _("Color syntax highlighting");
+#endif
#ifndef DISABLE_WRAPPING
toggle_wrap_msg = _("Auto wrap");
#endif
toggle_init_one(TOGGLE_MAC_KEY, toggle_mac_msg, MAC_FILE);
toggle_init_one(TOGGLE_BACKUP_KEY, toggle_backup_msg, BACKUP_FILE);
toggle_init_one(TOGGLE_SMOOTH_KEY, toggle_smooth_msg, SMOOTHSCROLL);
+#ifdef ENABLE_COLOR
+ toggle_init_one(TOGGLE_SYNTAX_KEY, toggle_syntax_msg, COLOR_SYNTAX);
+#endif
}
#ifdef DEBUG
case TOGGLE_MAC_KEY:
UNSET(DOS_FILE);
break;
+ case TOGGLE_SYNTAX_KEY:
+ edit_refresh();
+ break;
}
/* We are assuming here that shortcut_init() above didn't free and
* *
**************************************************************************/
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
exttype *extensions; /* List of extensions that this applies to */
colortype *color; /* color struct for this syntax */
struct syntaxtype *next;
-
} syntaxtype;
#endif /* ENABLE_COLOR */
#define NO_CONVERT (1<<26)
#define BACKUP_FILE (1<<27)
#define NO_RCFILE (1<<28)
+#define COLOR_SYNTAX (1<<28)
/* Control key sequences, changing these would be very very bad */
#define TOGGLE_SMOOTH_KEY NANO_ALT_S
#define TOGGLE_NOCONVERT_KEY NANO_ALT_N
#define TOGGLE_BACKUP_KEY NANO_ALT_B
+#define TOGGLE_SYNTAX_KEY NANO_ALT_Y
#endif /* !NANO_SMALL */
#define MAIN_VISIBLE 12
if (syntaxes == NULL) {
syntaxes = (syntaxtype *)nmalloc(sizeof(syntaxtype));
tmpsyntax = syntaxes;
+ SET(COLOR_SYNTAX);
} else {
for (tmpsyntax = syntaxes; tmpsyntax->next != NULL;
tmpsyntax = tmpsyntax->next)
mvwaddnstr(edit, yval, 0, &fileptr->data[start], COLS);
#ifdef ENABLE_COLOR
- if (colorstrings != NULL) {
+ if (colorstrings != NULL && ISSET(COLOR_SYNTAX)) {
const colortype *tmpcolor = colorstrings;
for (; tmpcolor != NULL; tmpcolor = tmpcolor->next) {