I have 'set trimblanks' in .nanorc and yet, most of the time, files get saved with some trailing whitespace remaining. Setting the option really should trim at all times, prior to saving a file. Right now, it seemingly only trims following a justify command within the editor. Martin-Éric
Op 09-11-2024 om 11:17 schreef Martin-Éric Racine:
One could argue that the option is poorly named, but... users should
really read the documentation. For trimblanks, `man nanorc` says:
"Snip trailing whitespace from the wrapped line _when_ automatic
hard-wrapping occurs or _when_ text is justified."
You can arrange the trimming of all trailing whitespace yourself.
Search for "snipping" in the sample nanorc:
grep -A1 snipping /usr/share/doc/nano/examples/sample.nanorc
That gives:
## For snipping trailing blanks when you save a file:
# bind ^S "{execute}| sed 's/\s\+$//' {enter}{savefile}" main
Benno
la 9. marrask. 2024 klo 13.56 Benno Schulenberg (bensberg@telfort.nl) kirjoitti: Poorly named is an understatement, since this actually is conditional to actions within the editor. Which really isn't quite the same. This now requires using an entirely different keystroke than the usual save action. Martin-Éric