diff -wu -r nano-1.2.3/configure nano-1.2.3p/configure --- nano-1.2.3/configure Tue Feb 17 20:35:57 2004 +++ nano-1.2.3p/configure Thu Apr 8 12:58:02 2004 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for GNU Nano 1.2.3. +# Generated by GNU Autoconf 2.59 for GNU Nano 1.2.3p. # # Report bugs to . # @@ -269,8 +269,8 @@ # Identity of this package. PACKAGE_NAME='GNU Nano' PACKAGE_TARNAME='nano' -PACKAGE_VERSION='1.2.3' -PACKAGE_STRING='GNU Nano 1.2.3' +PACKAGE_VERSION='1.2.3p' +PACKAGE_STRING='GNU Nano 1.2.3p' PACKAGE_BUGREPORT='address@hidden' ac_unique_file="nano.c" @@ -780,7 +780,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GNU Nano 1.2.3 to adapt to many kinds of systems. +\`configure' configures GNU Nano 1.2.3p to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -846,7 +846,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU Nano 1.2.3:";; + short | recursive ) echo "Configuration of GNU Nano 1.2.3p:";; esac cat <<\_ACEOF @@ -996,7 +996,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -GNU Nano configure 1.2.3 +GNU Nano configure 1.2.3p generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -1010,7 +1010,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GNU Nano $as_me 1.2.3, which was +It was created by GNU Nano $as_me 1.2.3p, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1622,7 +1622,7 @@ # Define the identity of the package. PACKAGE='nano' - VERSION='1.2.3' + VERSION='1.2.3p' cat >>confdefs.h <<_ACEOF @@ -8384,7 +8384,7 @@ } >&5 cat >&5 <<_CSEOF -This file was extended by GNU Nano $as_me 1.2.3, which was +This file was extended by GNU Nano $as_me 1.2.3p, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -8447,7 +8447,7 @@ cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -GNU Nano config.status 1.2.3 +GNU Nano config.status 1.2.3p configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" diff -wu -r nano-1.2.3/global.c nano-1.2.3p/global.c --- nano-1.2.3/global.c Tue Aug 5 12:31:12 2003 +++ nano-1.2.3p/global.c Thu Apr 8 11:42:57 2004 @@ -89,6 +89,10 @@ /* More stuff for the marker select */ #ifndef NANO_SMALL +int last_highlight_y; /* line with the last highlighted bracket */ +#endif + +#ifndef NANO_SMALL filestruct *mark_beginbuf; /* the begin marker buffer */ int mark_beginx; /* X value in the string to start */ #endif diff -wu -r nano-1.2.3/nano.c nano-1.2.3p/nano.c --- nano-1.2.3/nano.c Sat Dec 27 08:35:21 2003 +++ nano-1.2.3p/nano.c Thu Apr 8 11:45:59 2004 @@ -206,6 +206,10 @@ totsize = 0; placewewant = 0; +#ifndef NANO_SMALL + last_highlight_y = -1; +#endif + #ifndef DISABLE_WRAPJUSTIFY fill = wrap_at; if (fill <= 0) @@ -1023,6 +1027,18 @@ #if !defined(DISABLE_WRAPPING) || defined(ENABLE_COLOR) if (refresh) edit_refresh(); +#endif + +#ifndef NANO_SMALL + if (last_highlight_y >= 0) + edit_refresh(); + + /* flash brackets */ + if (ch == '}' || ch == ']' || ch == ')') { + current_x--; + do_flash_bracket(); + current_x++; + } #endif } Only in nano-1.2.3: nano.spec diff -wu -r nano-1.2.3/proto.h nano-1.2.3p/proto.h --- nano-1.2.3/proto.h Sat Dec 27 08:35:21 2003 +++ nano-1.2.3p/proto.h Thu Apr 8 11:42:45 2004 @@ -70,6 +70,7 @@ extern filestruct *current, *fileage, *edittop, *editbot, *filebot; extern filestruct *cutbuffer; #ifndef NANO_SMALL +extern int last_highlight_y; extern filestruct *mark_beginbuf; #endif @@ -374,6 +375,7 @@ void do_gotopos(int line, int pos_x, int pos_y, int pos_placewewant); #endif int do_find_bracket(void); +int do_flash_bracket(void); #ifndef NANO_SMALL void history_init(void); historytype *find_node(historytype *h, char *s); @@ -485,6 +487,7 @@ int line_len(const char *ptr); int do_help(void); int keypad_on(WINDOW *win, int newval); +void highlight_char(WINDOW *win, int y, int x, char c); void do_replace_highlight(int highlight_flag, const char *word); void fix_editbot(void); #ifdef DEBUG diff -wu -r nano-1.2.3/search.c nano-1.2.3p/search.c --- nano-1.2.3/search.c Tue Feb 17 20:33:53 2004 +++ nano-1.2.3p/search.c Thu Apr 8 11:18:35 2004 @@ -885,10 +885,20 @@ #if !defined(NANO_SMALL) && defined(HAVE_REGEX_H) int do_find_bracket(void) { + do_find_or_flash_bracket(0); +} + +int do_flash_bracket(void) +{ + do_find_or_flash_bracket(1); +} + +int do_find_or_flash_bracket(int is_flash) +{ char ch_under_cursor, wanted_ch; const char *pos, *brackets = "([{<>}])"; char regexp_pat[] = "[ ]"; - int offset, have_search_offscreen = 0, flagsave, current_x_save, count = 1; + int offset, line, have_search_offscreen = 0, flagsave, current_x_save, count = 1; filestruct *current_save; ch_under_cursor = current->data[current_x]; @@ -935,10 +945,22 @@ /* found complementary bracket */ if (!(--count)) { + if(is_flash) { + if (have_search_offscreen) { + statusbar(_("Matched line %ld: %s"), current->lineno, current->data); + } else { + line = current->lineno - edittop->lineno; + assert(line < 0 || line == check_linenumbers(current)); + highlight_char(edit, line, current_x, current->data[current_x]); + } + current_x = current_x_save; + current = current_save; + } else { if (have_search_offscreen) edit_update(current, CENTER); else update_line(current, current_x); + } placewewant = xplustabs(); reset_cursor(); break; diff -wu -r nano-1.2.3/winio.c nano-1.2.3p/winio.c --- nano-1.2.3/winio.c Tue Sep 16 19:36:56 2003 +++ nano-1.2.3p/winio.c Thu Apr 8 11:43:23 2004 @@ -1736,6 +1736,21 @@ free(highlight_word); } +/* Highlight a character */ +void highlight_char(WINDOW *win, int y, int x, char c) { +#ifndef NANO_SMALL + last_highlight_y = y; +#endif NANO_SMALL + wattron(win, A_REVERSE); + wmove(win, y, x); + wechochar(win, c); + wattroff(edit, A_REVERSE); + + /* Restore cursor in edit buffer, if necessary */ + if (win == edit && (y != current_y || x != current_x)) + wmove(edit, current_y, current_x); +} + /* Fix editbot, based on the assumption that edittop is correct. */ void fix_editbot(void) {