Commit Graph

212 Commits (c01b13a32c75b8760890bfa63b67acdc3cbd99a2)

Author SHA1 Message Date
Benno Schulenberg c01b13a32c syntax: php: colorize the full short tag for echo (<?=) 2021-05-05 12:09:17 +02:00
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
Hussam al-Homsi 96ebaf8ab4 syntax: c: make the highlighting of '#include <...>' more compliant
Changes:
  1. There may be zero spaces between 'include' and '<...>'.
  2. Blanks and '=' may occur inside '<...>' but '>' may not.
  3. There must be at least one character inside '<...>'.

References:
  Change 1:
    C:   www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf#subsection.6.10.2
    C++: www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf#section.19.2

  Changes 2 and 3:
    C:   www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf#subsection.6.4.7
    C++: www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf#section.5.8

Signed-off-by: Hussam al-Homsi <sawuare@gmail.com>
2021-04-26 12:14:44 +02:00
Benno Schulenberg 6b7c661fb7 syntax: po: improve the coloring of format specifiers
This now handles most of the things listed in 'man 3 printf'.
2021-04-26 11:29:05 +02:00
Benno Schulenberg c3cdb099da tweaks: reshuffle a comment, and put the main extension first
And add some air to the compact file.
2021-04-05 16:06:54 +02:00
Mike Frysinger 682a088fb8 syntax: tcl: support Expect scripts too 2021-04-05 16:02:44 +02:00
Benno Schulenberg 3d9e803aed syntax: c: colorize also labels that contain digits, and uncolorize colon
Labels may contain digits (after the first character).
And the colon after "default" should not be colored.

Inspired-by: Hussam al-Homsi <sawuare@gmail.com>
2021-03-22 11:41:08 +01: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 6a3ba2ab50 syntax: sh: recognize shebangs with any shell after 'env', not just 'sh'
(Inspired by a complaint seen somewhere on Stackoverflow.)
2020-12-25 17:05:02 +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 208146f2f2 syntax: go: add author and license line
In the original submission (https://savannah.gnu.org/patch/?8189)
the submitter said: "I hereby put it into the public domain."

Public-domain license: https://directory.fsf.org/wiki/License:CC0

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2020-12-10 15:48:28 +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 7c698a9c3a syntax: sh: recognize some shell scripts by their Emacs modeline
This helps with recognizing most files in /usr/share/bash*/completions/,
where --magic is powerless.
2020-09-28 11:56:17 +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
Ryan Westlund 11ae201d71 syntax: markdown: add author and license line
Signed-off-by: Ryan Westlund <rlwestlund@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2020-09-15 19:11:35 +02:00
Arturo Borrero González 8586efda0b syntax: nftables: include author and license lines
Signed-off-by: Arturo Borrero González <arturo@debian.org>
2020-09-14 19:52:25 +02:00
Benno Schulenberg 9e382ba691 syntaxes: add author and license lines to four of the files
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2020-09-14 19:38:29 +02:00
Benno Schulenberg 3940032cd3 syntax: po: do not leave the occasional tab with a red background color 2020-09-10 19:48:31 +02:00
Benno Schulenberg 0bc834e6f3 syntax: po: highlight embedded control codes that shouldn't be there
For some reason the Romanian PO file contains a literal ^Q in one
of its translated messages -- currently at line 1984.  This stray
^Q causes 'file' to classify po/ro.po as data.

Make such mistaken control codes easier to spot when using nano.
2020-09-08 19:38:55 +02:00
Benno Schulenberg c771167b6a tweaks: add some comments to the C syntax, and sort some keywords
Also, fold three regexes into one, eliding some redundant parentheses.
2020-09-06 11:14:16 +02:00
Hussam al-Homsi e1cf93640c syntax: c: colorize also the keywords that start with an underscore
Signed-off-by: Hussam al-Homsi <sawuare@gmail.com>
2020-09-06 10:48:07 +02:00
Hussam al-Homsi 1716f140b7 syntax: c: colorize also the 'restrict' keyword, and the #line directive
Signed-off-by: Hussam al-Homsi <sawuare@gmail.com>
2020-09-06 10:44:43 +02:00
Hussam al-Homsi cab9294f62 syntax: c: colorize also one-character constants, and the null directive
Constants that consist of a single character are valid too.
And a lone hash character on a line by itself also.

Signed-off-by: Hussam al-Homsi <sawuare@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2020-09-05 13:25:54 +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 59bdce9503 syntax: default: colorize also "GNU nano 5.x" 2020-07-30 09:25:56 +02:00
Benno Schulenberg 9517766aab syntax: css: differentiate pseudo-classes (now cyan) from comments (blue)
Also, add comments, remove a duplicated ":link", and add ":checked".
2020-07-30 09:25:12 +02:00
Benno Schulenberg f502f6fdb2 syntaxes: remove unneeded backslash escapes before quotes
(They may have been needed in the past to avoid miscoloring of the
nanorc file itself, but they are no longer needed now.)
2020-07-27 13:23:13 +02:00
Benno Schulenberg aabfefde7e syntax: css: color multiline comments correctly
A forward slash does not need to be escaped, and the backslash itself
should not be escaped: it serves to escape the star, to make it literal.

Also, remove a stray end-of-line anchor ($).
2020-07-26 19:54:02 +02:00
Andreas K. Foerster ad2490c3fc syntax: ada: new file -- coloring rules for Ada 2012 files
Signed-off-by: Andreas K. Foerster <akf@akfoerster.de>
2020-06-21 09:33:14 +02:00
Benno Schulenberg af5010c96f syntax: default: colorize embedded control codes 2020-06-20 13:54:48 +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 e998c35c53 syntax: sql: rename the file to match the name of the syntax 2020-06-16 14:44:57 +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