Commit Graph

69 Commits (544351f3beeffb3a1d25d861c159feec221ff00a)

Author SHA1 Message Date
Benno Schulenberg 544351f3be syntaxes: replace [[:space:]] with [[:blank:]] to exclude carriage return
In many places a carriage return is not valid whitespace and should
thus not be colored as such.  In some of these places a vertical tab
or form feed is maybe valid whitespace, but it would be ugly or even
wrong to color them because they are not part of the subsequent
comment or keyword.

This fixes https://savannah.gnu.org/bugs/?60456.
2021-04-27 11:18:41 +02:00
Benno Schulenberg ac5e5179fb options: rename 'highlightcolor' to the more distinct 'spotlightcolor'
This way there cannot be any confusion with syntax highlighting,
and it indicates better that a single place will be highlighted.
2021-03-03 09:31:46 +01:00
Benno Schulenberg 87fe73ddaa color: give highlighted text its own color, to not look like marked text
Now that a search match gets highlighted, the unsuspecting user might
think that the text is selected, because it is colorized the same way
as selected text.  Avoid this by colorizing a highlighted search match
with its own specific color, black on yellow by default.
2021-02-14 12:51:09 +01:00
Benno Schulenberg 7bf253702e options: remove --markmatch and 'set markmatch', as the behavior is gone 2021-02-07 09:18:15 +01:00
Benno Schulenberg 1e16a3f411 syntax: nanorc: colorize 'bookstyle' as a valid option
This fixes https://savannah.gnu.org/bugs/?59769.
Reported-by: Tiago Almeida <tjamadeira@gmail.com>

Bug existed since version 5.0, since --bookstyle was introduced.
2020-12-29 09:36:42 +01:00
Benno Schulenberg ca398fdfdf docs: explain the purpose of --markmatch / -^ / 'set markmatch'
Also, colorize 'set markmatch' as a valid option in a nanorc file.
2020-12-24 11:49:49 +01:00
Benno Schulenberg e353203010 docs: explain the effect of --minibar / -_ / 'set minibar'
Also, colorize 'set minibar' as valid option in a nanorc file.
2020-12-23 17:15:06 +01:00
Benno Schulenberg c44a5e960e syntax: nanorc: colorize 'set promptcolor' as valid 2020-12-07 11:19:48 +01:00
Benno Schulenberg 26f5c8b9d5 rcfile: stop accepting 'set view' in a nanorc file, and undocument it
Like --restricted, --view really only makes sense on the command line.
2020-10-10 12:42:20 +02:00
Benno Schulenberg 2c41600957 docs: explain the purpose of -! / --magic / 'set magic'
Also, colorize 'set magic' as valid option in a nanorc file.
2020-09-25 16:35:50 +02:00
Benno Schulenberg 844c671bf1 docs: explain what the options --stateflags (-%) and 'set stateflags' do
Also, colorize 'set stateflags' as valid option in a nanorc file.
2020-09-23 19:48:03 +02:00
Benno Schulenberg cb56cd70f5 syntax: nanorc: stop coloring 'quiet' and 'backwards' and 'finalnewline'
Those options have been obsolete for a long time already.
2020-09-21 10:37:48 +02:00
Benno Schulenberg de0395bee9 syntax: nanorc: stop coloring 'nopauses' and 'nowrap' as valid
Those options are obsolete or deprecated.
2020-09-21 10:15:30 +02:00
Benno Schulenberg abb5b14281 syntax: nanorc: stop coloring 'morespace' and 'smooth' as valid
Those options are deprecated, so should not be colored green but red.
2020-09-21 10:12:31 +02:00
Benno Schulenberg b122d3b8e5 docs: explain the 'set scrollercolor' option, for coloring the indicator
And mention that a background color does not work on libvte before 0.55.

To find out the version of libvte on your system:

  ls -R1 /usr/lib | grep libvte | grep 00 | grep -o "0\..."
2020-09-02 19:55:24 +02:00
Benno Schulenberg 8b2114a25f rcfile: allow to bind M-[ (even though it is an escape-sequence starter)
The user had better avoid using the keystroke in a macro, but
when typing directly at a responsive machine there is no problem,
M-[ is a perfectly valid and recognizable keystroke.

This fulfills https://savannah.gnu.org/bugs/?58820.
2020-08-04 17:28:16 +02:00
Benno Schulenberg fae2eeadce rcfile: introduce the modifier 'italic', for slanted text
The modifier has to come before the foreground color name, separated
by a comma, and after 'bold,' (when present).  This has no effect on
terminals that are incapable of cursive text, like the Linux console.

This fulfills https://savannah.gnu.org/bugs/?56525.
2020-06-18 15:31:06 +02:00
Benno Schulenberg c35c5af5d8 syntax: nanorc: colorize the new named colors too, from "mint" to "mauve" 2020-06-17 11:29:05 +02:00
Benno Schulenberg 96a5aa9e90 syntax: nanorc: colorize 'bright' anyway, so existing syntaxes look okay
After a year or so, when people have had time to convert their syntaxes
to use 'bold' and/or 'light' instead of 'bright', we can drop this
colorizing, and still later stop recognizing 'bright' altogether.
2020-06-16 17:33:49 +02:00
Benno Schulenberg 2fd9974e0e syntax: nanorc: stop colorizing 'bright', even though it's still accepted
The name 'bright' does not fit its effect (often bolding the typeface),
so better discourage its use.

Furthermore, colorize 'bold' and 'light' also for interface colors.
2020-06-15 15:15:06 +02:00
Benno Schulenberg c275c5158e rcfile: introduce the modifier "bold", for specifying bolding separately
This makes it possible to avoid the misnamed prefix "bright".  It is
misnamed because (on current terminal emulators, when the brightening
of bold is switched off) it just makes the typeface bold, not the color
brighter.  The prefix "light" will now only make the color brigther,
and the modifier "bold" will just make the typeface bold (on terminal
emulators, when the brightening of bold is switched off).

On a Linux console, which is not capable of bolding the typeface,
"bold" will brighten the color.

This fully fulfills https://savannah.gnu.org/bugs/?58503.
2020-06-14 11:54:18 +02:00
Benno Schulenberg adf7f33ea8 rcfile: allow specifying a bright background color (with prefix "light")
If the terminal is capable of more than eight colors, specifying
indexes 8 to 15 works fine for getting a light background color.
2020-06-14 11:51:00 +02:00
Benno Schulenberg 4d10f583e4 rcfile: accept prefix "light" to make a color brighter without bolding it
The prefix "bright" will continue to make the color brighter AND/OR
make the typeface bold (depending on how the terminal is configured
and on its capabilities), but the prefix "light" will just make the
color brighter (if the terminal can do that).

The prefix "bright" continues to do the same as what it did before,
to not change the appearance of user-defined syntaxes.  And having
an option to change the meaning of "bright"... would be confusing.

This partially fulfills https://savannah.gnu.org/bugs/?58503.
2020-06-14 11:45:45 +02:00
Benno Schulenberg 32ee39e44a docs: document the --indicator (-q) and 'set indicator' options 2020-06-04 18:52:28 +02:00
Benno Schulenberg d9106abfda rcfile: rename 'extcmd' to 'execute', to be more readable and fitting
Also, improve its description in the documentation.
2020-05-31 12:04:58 +02:00
Benno Schulenberg d4ee6a2b53 options: rename --tempfile to --saveonexit, to be far clearer
A long option should describe what it does, not vaguely hint at it.

Also, in several places of nano's code we deal with actual temp files,
and then having a flag called TEMP_FILE that doesn't have anything to
do with temp files is somewhat confusing.
2020-04-30 19:12:54 +02:00
Benno Schulenberg fea5d7c612 syntaxes: uniformize the initial comment 2020-04-20 19:21:56 +02:00
Benno Schulenberg a91bc04e04 docs: update the form of an option, --suspendable / 'set suspendable' 2020-03-13 15:58:56 +01:00
Benno Schulenberg e09ed765a1 syntax: nanorc: colorize 'rawsequences', not the obsolete 'rebindkeypad'
Bug existed since version 4.0, commit b596639f.
2020-03-10 16:21:02 +01:00
Benno Schulenberg 2651554721 syntax: nanorc: colorize all-lowercase Meta key binds as valid too
Also, colorize as valid only ASCII letters, not any Unicode letters.
2020-01-23 13:34:37 +01:00
Benno Schulenberg f9baa4de71 syntax: nanohelp, nanorc: colorize the Sh-M-X format as a valid key name 2020-01-23 11:11:34 +01:00
Benno Schulenberg 54b97a6f03 bindings: allow to rebind also ^`, although it is synonymous with ^Space
Since ^@ is rebindable too and also a synonym of ^Space, it makes
more sense to allow the user to specify ^` instead, as it is an
unshifted keystroke on US keyboards.

Also, color ^` as valid in a nanorc file, and color ^` and ^@ in
the help viewer.
2020-01-20 17:19:23 +01:00
Benno Schulenberg 2a97cb9f41 bindings: allow to rebind ^/, even though it is synonymous with ^_
This fixes https://savannah.gnu.org/bugs/?57302.
Reported-by: Tiago Almeida <tjamadeira@gmail.com>
2019-11-26 19:25:24 +01:00
Benno Schulenberg 4281b6becb commands: rename 'fixer' to 'formatter', to be less misleading
The word "fixer" sounds too much as if the command would be able
to fix mistakes or correct errors.  Especially when seen next to
"linter", it sounds as if one does a syntax check and the other
fixes the found mistakes.  (Although the command might in theory
be used for this, it is not its intended purpose.)
2019-10-25 17:24:28 +02:00
Benno Schulenberg 3d5e51bcd0 syntax: nanorc: colorize in bright red everything that is invalid
Random words or mistyped keywords should not stay uncolored.
2019-10-20 14:47:15 +02:00
Benno Schulenberg 69d2045c9f syntax: nanorc: colorize only lowercase keywords as valid
Nowhere does the manual say that nanorc keywords are case-insensitive,
and none of the examples use uppercase keywords.  So, simply consider
uppercase keywords to be invalid.  This will later allow nano to use
case-sensitive comparisons, which are slightly faster.
2019-10-14 11:45:56 +02:00
Benno Schulenberg b8dc8d4a37 syntax: nanorc: colorize all arguments of 'fixer' and 'linter' as valid 2019-10-14 10:28:45 +02:00
Benno Schulenberg 8749ccb469 syntax: nanorc: colorize the 'fixer' command as valid
Also add a default formatting command to the Go syntax.
2019-10-14 10:28:45 +02:00
Benno Schulenberg f813fd0f4d rcfile: allow binding also F17...F24
For historical reasons the rebinding code allows binding F13...F16,
which on most terminals are typable with Shift plus F1...F4.  But,
at least on an Xfce Terminal, Shift plus F1...F12 produce F13...F24.
On a Linux console, Shift plus F1...F8 produce F13...F20.  So: allow
to bind the full shifted F13...F24 range.  It costs no extra code
and makes things more rounded.
2019-10-07 16:23:40 +02:00
Benno Schulenberg 3644d51b97 new feature: a 'tabgives' command to define what the Tab key produces
The 'tabgives' command is syntax-specific and should be followed by a
string containing the character(s) that a single press of the <Tab> key
should produce -- most likely a single TAB or a small bunch of spaces,
but any string is allowed.  This overrides the 'tabstospaces' option.

When one wants to make sure <Tab> inserts always four spaces and never
a TAB when editing a Python file, one could add to one's nanorc:

  extendsyntax python tabgives "    "

where there are four spaces between the quotes.  And when one wants
to ensure, when editing a Makefile, that <Tab> always inserts a TAB
and never spaces, independent of what tabstospaces is set to, one
could add to one's nanorc:

  extendsyntax makefile tabgives "	"

where there is a literal TAB character between the quotes.

This fulfills https://savannah.gnu.org/bugs/?53661,
Requested-by: Andrew Pennebaker <andrew.pennebaker@gmail.com>
And addresses https://savannah.gnu.org/bugs/?54760.
Requested-by: Henry van Megen <hvanmegen@gmail.com>
And addresses part of https://savannah.gnu.org/bugs/?54775.
Requested-by: Dirkjan Ochtman <dirkjan@ochtman.nl>
2019-09-25 19:35:07 +02:00
Benno Schulenberg 5375403b9d syntax: nanorc: colorize also strings preceded by 'start=' or 'end=' 2019-04-02 12:01:56 +02:00
Benno Schulenberg f8e0320722 syntax: nanorc: require whitespace both before and after a quoted string
This ensures that the keyname M-" is not miscolored.
2019-04-01 17:24:19 +02:00
Benno Schulenberg 9ad3a17954 syntax: nanorc: stop coloring 'unset fill ...' as if it were valid
The same for 'unset tabsize ...'.

Also, color 'set guidestripe' plus a following number as valid.
2019-03-09 09:27:08 +01:00
Benno Schulenberg 916b4d81d0 rcfile: add 'stripecolor' for changing the color of the guiding stripe
The default is now simply reverse video, which works better than a
"loud" colored bar in an interface that for the rest is monochrome.
2019-03-09 09:27:08 +01:00
Benno Schulenberg 4d40bea58a rcfile: add the options that correspond to -b, -f, -j, and -e 2019-02-18 09:34:18 +01:00
Brand Huntsman ae3ec1784d options: add --zap, that makes <Bsp> and <Del> erase a marked region
Using --zap or -Z on the command line, or 'set zap' in a nanorc file,
makes the <Bsp> and <Del> keys erase selected text (a marked region)
as they do in some other editors, and without affecting the cutbuffer.

This fulfills https://savannah.gnu.org/bugs/?54837.
Requested-by: Liu Hao <lh_mouse@126.com>

Signed-off-by: Brand Huntsman <alpha@qzx.com>
2018-11-04 11:46:57 +01:00
Benno Schulenberg 636e9ac3e8 syntaxes: remove several redundant end-of-line anchors from regexes 2018-11-03 21:12:44 +01:00
Benno Schulenberg 2d434f63e2 syntaxes: remove all traces of the 'formatter' command 2018-08-09 21:12:10 +02:00
Benno Schulenberg db1893ef2d syntax: nanorc: recognize 'yesno' as a valid menu to bind/unbind keys in 2018-08-06 18:05:10 +02:00
Benno Schulenberg acadf71b13 syntax: nanorc: show ^@ as validly rebindable, but not any ^digit 2018-07-11 14:14:40 +02:00