Comment 3 for bug 1361131

Revision history for this message
Benno Schulenberg (bennoschulenberg) wrote :

Code is inspected far more often than it is written, and when inspecting code, some people do want to be alerted to trailing whitespace. So that's why it is in several of the *.nanorc files. However, those files in /usr/share/nano are just examples -- they are meant to be customized by the user. Most distributions, however, include and activate them by default.

By the way, it is not necessary to edit the files in /usr/share/nano; you can instead redefine any syntax in your ~/.nanorc: just put in 'syntax "sh" "\.sh$"' and follow it by the color commands that you do want.

(In newer nanos (2.4.0 and higher) there is no need to completely redefine a syntax; you can just add or override things with 'extendsyntax'. In your case you would put 'extendsyntax sh color black, "[[:space:]]+$"' to get rid of the trailing-whitespace colouring.)

If, when reading code, you do want trailing whitespace to be highlighted, you can just toggle syntax colouring off with Alt+Y while you are typing the code, and toggle it back on when you are done writing.

Okay, all that is selfhelp. But if you think that for most people the colouring of trailing whitespace should never be the default, you could report a bug to nano itself (https://savannah.gnu.org/bugs/?group=nano) or send an email to its development list (https://lists.gnu.org/mailman/listinfo/nano-devel).