Call kill_spaces_on_justify justifytrim, to match the rest of rcfile naming conventions.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5679 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2016-02-25 21:04:45 +00:00
parent 486e828443
commit 9f98333dce
7 changed files with 12 additions and 6 deletions

View File

@ -17,7 +17,7 @@
2016-02-22 Chris Allegretta <chrisa@asty.org> 2016-02-22 Chris Allegretta <chrisa@asty.org>
* Add the ability to kill the trailing spaces when justifying text, * 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 whether this warrants a command-line flag or not. Now with slightly
better logic for multi-spaced lines. better logic for multi-spaced lines.

View File

@ -111,6 +111,9 @@ See \fBset titlecolor\fR for more details.
Enable the use of \fB~/.nano/search_history\fP for saving and reading Enable the use of \fB~/.nano/search_history\fP for saving and reading
search/replace strings. search/replace strings.
.TP .TP
.B set justifytrim
When justifying text, trailing newlines will automatically be removed.
.TP
.B set keycolor \fIfgcolor\fR,\fIbgcolor\fR .B set keycolor \fIfgcolor\fR,\fIbgcolor\fR
Specify the color combination to use for the shortcut key combos Specify the color combination to use for the shortcut key combos
in the two help lines at the bottom of the screen. in the two help lines at the bottom of the screen.

View File

@ -60,6 +60,9 @@
## Remember the used search/replace strings for the next session. ## Remember the used search/replace strings for the next session.
# set historylog # 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 ## 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 ## 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. ## no plans to implement vim-style undo state in these files.

View File

@ -6,7 +6,7 @@ syntax "nanorc" "\.?nanorc$"
icolor brightred "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|linter|i?color|extendsyntax).*$" icolor brightred "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|linter|i?color|extendsyntax).*$"
# Keywords # 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 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:]]*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:]]*$)" 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:]]*$)"

View File

@ -518,7 +518,7 @@ enum
LOCKING, LOCKING,
NOREAD_MODE, NOREAD_MODE,
MAKE_IT_UNIX, MAKE_IT_UNIX,
KILL_TRAILING_SPACES JUSTIFY_TRIM
}; };
/* Flags for the menus in which a given function should be present. */ /* Flags for the menus in which a given function should be present. */

View File

@ -90,7 +90,7 @@ static const rcoption rcopts[] = {
{"backwards", BACKWARDS_SEARCH}, {"backwards", BACKWARDS_SEARCH},
{"casesensitive", CASE_SENSITIVE}, {"casesensitive", CASE_SENSITIVE},
{"cut", CUT_TO_END}, {"cut", CUT_TO_END},
{"kill_spaces_on_justify", KILL_TRAILING_SPACES}, {"justifytrim", JUSTIFY_TRIM},
{"locking", LOCKING}, {"locking", LOCKING},
{"matchbrackets", 0}, {"matchbrackets", 0},
{"noconvert", NO_CONVERT}, {"noconvert", NO_CONVERT},

View File

@ -1279,7 +1279,7 @@ bool do_wrap(filestruct *line)
/* If after_break doesn't end in a blank, make sure it ends in a /* If after_break doesn't end in a blank, make sure it ends in a
* space. */ * space. */
if (!is_blank_mbchar(end) && !ISSET(KILL_TRAILING_SPACES)) { if (!is_blank_mbchar(end) && !ISSET(JUSTIFY_TRIM)) {
#ifndef NANO_TINY #ifndef NANO_TINY
add_undo(ADD); add_undo(ADD);
#endif #endif
@ -2176,7 +2176,7 @@ void do_justify(bool full_justify)
#endif #endif
/* Break the current line. */ /* Break the current line. */
if (ISSET(KILL_TRAILING_SPACES)) { if (ISSET(JUSTIFY_TRIM)) {
while (break_pos > 0 && while (break_pos > 0 &&
is_blank_mbchar(&openfile->current->data[break_pos-1])) { is_blank_mbchar(&openfile->current->data[break_pos-1])) {
break_pos--; break_pos--;