2008-08-01 08:03:24 UTC
for example \< (beginning of word), \> (end of word) and \b (word
boundary). This causes a usability bug with the nano editor, which
uses these sequences extensively in most of its syntax highlighting
rules. For example, in /usr/share/nano/c.nanorc, one of the rules goes
color brightyellow "\<(for|if|while|do|else|case|default|switch)\>"
\< and \> are used so that other words, e.g. 'fifo', 'elsewhere',
'undo' don't match, as they aren't keywords.
Test case 1:
Open nano and write a test message, for example "if a fifo is full".
Do a regexp search (using ^W M-R) for "\<if\>". No matches will be
found, because \< and \> don't have their special meaning and simply
match the characters < and >.
Test case 2:
To include C syntax rules, do: echo 'include
"/usr/share/nano/c.nanorc"' >> ~/.nanorc
Open a C source file in nano. Enable syntax highlighting with M-Y.
Strings and preprocessor instructions are highlighted (because those
rules don't contain \< \>), but keywords (e.g. if, for, return)
I tested both nano 2.0.6 (currently in cygwin) and 2.0.7 (latest
stable version, compiled manually from source). The problem wasn't
present in Linux glibc nano 2.0.7. When I found out that Cygwin uses
newlib instead of glibc, it led me to believe that insufficient regex
support in newlib might be the cause.
I attached the output of cygcheck -s -r -v, but I doubt this is a
problem with my system configuration.
Thank you for your time reading this.