2016-02-22 Chris Allegretta <chrisa@asty.org>
* Add the ability to kill the trailing spaces when justifying text,
- by adding a new nanorc option 'kill_spaces_on_justify' -- we'll see
+ by adding a new nanorc option 'justifytrim' -- we'll see
whether this warrants a command-line flag or not. Now with slightly
better logic for multi-spaced lines.
Enable the use of \fB~/.nano/search_history\fP for saving and reading
search/replace strings.
.TP
+.B set justifytrim
+When justifying text, trailing newlines will automatically be removed.
+.TP
.B set keycolor \fIfgcolor\fR,\fIbgcolor\fR
Specify the color combination to use for the shortcut key combos
in the two help lines at the bottom of the screen.
## Remember the used search/replace strings for the next session.
# set historylog
+## Have the justify command kill whitespace at the end of lines
+# set justifytrim
+
## Enable vim-style lock-files. This is just to let a vim user know you
## are editing a file [s]he is trying to edit and vice versa. There are
## no plans to implement vim-style undo state in these files.
icolor brightred "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|linter|i?color|extendsyntax).*$"
# Keywords
-icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|autoindent|backup|backwards|boldtext|casesensitive|const(antshow)?|cut|fill|historylog|locking|morespace|mouse|multibuffer|noconvert|nohelp|nonewlines|nowrap|pos(ition)?log|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|smarthome|smooth|softwrap|suspend|tabsize|tabstospaces|tempfile|unix|view|wordbounds|kill_spaces_on_justify)\>"
+icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|autoindent|backup|backwards|boldtext|casesensitive|const(antshow)?|cut|fill|historylog|locking|morespace|mouse|multibuffer|noconvert|nohelp|nonewlines|nowrap|pos(ition)?log|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|smarthome|smooth|softwrap|suspend|tabsize|tabstospaces|tempfile|unix|view|wordbounds|justify_trim)\>"
icolor yellow "^[[:space:]]*set[[:space:]]+(functioncolor|keycolor|statuscolor|titlecolor)[[:space:]]+(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
icolor brightgreen "^[[:space:]]*set[[:space:]]+(backupdir|brackets|functioncolor|keycolor|matchbrackets|operatingdir|punct|quotestr|speller|statuscolor|titlecolor|whitespace)[[:space:]]+"
icolor brightgreen "^[[:space:]]*bind[[:space:]]+((\^|M-)([[:alpha:]]|space|[]]|[0-9^_=+{}|;:'\",./<>\?-])|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+[[:alpha:]]+[[:space:]]+(all|main|search|replace(2|with)?|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)([[:space:]]+#|[[:space:]]*$)"
LOCKING,
NOREAD_MODE,
MAKE_IT_UNIX,
- KILL_TRAILING_SPACES
+ JUSTIFY_TRIM
};
/* Flags for the menus in which a given function should be present. */
{"backwards", BACKWARDS_SEARCH},
{"casesensitive", CASE_SENSITIVE},
{"cut", CUT_TO_END},
- {"kill_spaces_on_justify", KILL_TRAILING_SPACES},
+ {"justifytrim", JUSTIFY_TRIM},
{"locking", LOCKING},
{"matchbrackets", 0},
{"noconvert", NO_CONVERT},
/* If after_break doesn't end in a blank, make sure it ends in a
* space. */
- if (!is_blank_mbchar(end) && !ISSET(KILL_TRAILING_SPACES)) {
+ if (!is_blank_mbchar(end) && !ISSET(JUSTIFY_TRIM)) {
#ifndef NANO_TINY
add_undo(ADD);
#endif
#endif
/* Break the current line. */
- if (ISSET(KILL_TRAILING_SPACES)) {
+ if (ISSET(JUSTIFY_TRIM)) {
while (break_pos > 0 &&
is_blank_mbchar(&openfile->current->data[break_pos-1])) {
break_pos--;