and add an updated FAQ entry about its use. Changes to
window_init(), usage(), main(), get_verbatim_kbinput(),
nanorc.sample, and faq.html. (DLR)
+ - Add new -W/--wordbounds command line option, and new
+ "wordbounds" rcfile option, to control whether
+ the word movement functions treat punctuation characters as
+ part of a word. Changes to do_next_word_void(),
+ do_prev_word_void(), usage(), main(), and nanorc.sample. (DLR,
+ suggested by Mike Frysinger)
- color.c:
- Remove unneeded fcntl.h include. (DLR)
- chars.c:
## (00B7 hexadecimal) seem to be good values for these.
# set whitespace " "
+## Detect word boundaries more accurately by treating punctuation
+## characters as part of a word.
+# set wordbounds
+
## Color setup
##
## Format:
## highlight possible errors and parameters
# icolor brightwhite "^[[:space:]]*(set|unset|syntax|i?color).*$"
## set, unset and syntax
-# icolor cyan "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|backupdir|backwards|brackets|casesensitive|const|cut|fill|historylog|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|punct|quickblank|quotestr|rebinddelete)\>" "^[[:space:]]*(set|unset)[[:space:]]+(rebindkeypad|regexp|smarthome|smooth|speller|suspend|tabsize|tabstospaces|tempfile|view|whitespace)\>"
+# icolor cyan "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|backupdir|backwards|brackets|casesensitive|const|cut|fill|historylog|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|punct|quickblank|quotestr|rebinddelete)\>" "^[[:space:]]*(set|unset)[[:space:]]+(rebindkeypad|regexp|smarthome|smooth|speller|suspend|tabsize|tabstospaces|tempfile|view|whitespace|wordbounds)\>"
# icolor green "^[[:space:]]*(set|unset|syntax)\>"
## colors
# icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
void do_next_word_void(void)
{
- do_next_word(FALSE, TRUE);
+ do_next_word(ISSET(WORD_BOUNDS), TRUE);
}
/* Move to the previous word in the current filestruct. If allow_punct
void do_prev_word_void(void)
{
- do_prev_word(FALSE, TRUE);
+ do_prev_word(ISSET(WORD_BOUNDS), TRUE);
}
#endif /* !NANO_SMALL */
#endif
print1opt("-V", "--version",
N_("Print version information and exit"));
+#ifndef NANO_SMALL
+ print1opt("-W", "--wordbounds",
+ N_("Detect word boundaries more accurately"));
+#endif
#ifdef ENABLE_COLOR
print1opt(_("-Y [str]"), _("--syntax=[str]"),
N_("Syntax definition to use"));
{"noconvert", 0, NULL, 'N'},
{"smooth", 0, NULL, 'S'},
{"quickblank", 0, NULL, 'U'},
+ {"wordbounds", 0, NULL, 'W'},
{"autoindent", 0, NULL, 'i'},
{"cut", 0, NULL, 'k'},
#endif
while ((optchr =
#ifdef HAVE_GETOPT_LONG
getopt_long(argc, argv,
- "h?ABC:EFHIKNOQ:RST:UVY:abcdefgijklmo:pr:s:tvwxz",
+ "h?ABC:EFHIKNOQ:RST:UVWY:abcdefgijklmo:pr:s:tvwxz",
long_options, NULL)
#else
getopt(argc, argv,
- "h?ABC:EFHIKNOQ:RST:UVY:abcdefgijklmo:pr:s:tvwxz")
+ "h?ABC:EFHIKNOQ:RST:UVWY:abcdefgijklmo:pr:s:tvwxz")
#endif
) != -1) {
switch (optchr) {
case 'V':
version();
exit(0);
+#ifndef NANO_SMALL
+ case 'W':
+ SET(WORD_BOUNDS);
+ break;
+#endif
#ifdef ENABLE_COLOR
case 'Y':
syntaxstr = mallocstrcpy(syntaxstr, optarg);
#define MORE_SPACE (1<<26)
#define TABS_TO_SPACES (1<<27)
#define QUICK_BLANK (1<<28)
-#define USE_UTF8 (1<<29)
+#define WORD_BOUNDS (1<<29)
+#define USE_UTF8 (1<<30)
/* Control key sequences. Changing these would be very, very bad. */
#define NANO_CONTROL_SPACE 0
{"smooth", SMOOTH_SCROLL},
{"tabstospaces", TABS_TO_SPACES},
{"whitespace", 0},
+ {"wordbounds", WORD_BOUNDS},
#endif
{NULL, 0}
};