Commit 76c4b33e authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

display a highlighted space for zero-length regex matches, so that we

have a reference point when we're replacing them


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1601 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 9 additions and 1 deletion
+9 -1
...@@ -119,6 +119,10 @@ CVS code - ...@@ -119,6 +119,10 @@ CVS code -
- Add a few efficiency/extensibility tweaks. (David Benbennick) - Add a few efficiency/extensibility tweaks. (David Benbennick)
- Convert to use the new low-level input functions, and remove - Convert to use the new low-level input functions, and remove
two last hardcoded widths left after the above tweaks. (DLR) two last hardcoded widths left after the above tweaks. (DLR)
do_replace_highlight()
- Display a highlighted space if the word length is zero, so
that we can see zero-length regexes we're replacing. (DLR;
suggested by Mike Frysinger)
- configure.ac: - configure.ac:
- Check for glib 2.x and then 1.2.x if we need glib. (DLR) - Check for glib 2.x and then 1.2.x if we need glib. (DLR)
- nano.spec.in: - nano.spec.in:
......
...@@ -2236,7 +2236,11 @@ void do_replace_highlight(int highlight_flag, const char *word) ...@@ -2236,7 +2236,11 @@ void do_replace_highlight(int highlight_flag, const char *word)
if (highlight_flag) if (highlight_flag)
wattron(edit, A_REVERSE); wattron(edit, A_REVERSE);
waddnstr(edit, word, y - 1); /* This is so we can show zero-length regexes. */
if (word_len == 0)
waddstr(edit, " ");
else
waddnstr(edit, word, y - 1);
if (word_len > y) if (word_len > y)
waddch(edit, '$'); waddch(edit, '$');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment