* Raku syntax: Fix strings and comments
Problematic code:
my @array1 = [
"'", "a", "b"
];
my @array2 = [
'"', 'a', 'b'
];
my @array3 = [
"#", "a", "b"
];
I deleted "default" because it was breaking comments with urls after
of my changes.
Some parts were taken from:
https://github.com/hankache/raku.nanorc/blob/master/raku.nanorc
* Raku syntax: fix strings
Code:
sub xyz(Str is encoded('utf8')) returns int32 is native('asdf') { * }
sub xyz(Str is encoded("utf8")) returns int32 is native("asdf") { * }
From python3.yaml
* Python syntax: multiline string should be comment.string, not comment
''' delimits multiline strings, not comments
* Python syntax: multiline string should be comment.string, not comment
''' delimits multiline strings, not comments
* Update python3.yaml for python3.10 keywords
* Clarified meaning of indentchar setting
The description "sets the indentation character" combined with the default value of a space led me to believe that this was a way to set a preference for tabs/spaces and choose a number of spaces per indentation all at once. I've updated the description to try to make its true function clearer.
* Added note on rmtrailingws
This behavior was unexpected for me, so it's probably good to let other users know which option has precedence.
* Added details to help command
Initially I kept trying to use `help <command-name>` rather than `help commands`
After 9ad4437, directly specifying color names (instead of syntax groups)
in syntax files no longer works. In particular *.patch and *.diff files
are not highlighted, since in patch.yaml direct colors names are used.
Restore the previous behavior of GetColor (fallback to direct colors if
no syntax group found) to fix this regression, but also make some changes
in StringToStyle and StringToColor to still fix the issue which was fixed
by 9ad4437. In other words, ensure that there is no confusion between
direct colors ("red", "green" etc) and syntax groups omitted in the
colorscheme file.
* Support for highlighting all search matches (hlsearch)
hlsearch is implemented efficiently using the buffer's line array,
somewhat similarly to the syntax highlighting.
Unlike the syntax highlighter which highlights the entire file,
hlsearch searches for matches for the displayed lines only.
Matches are searched when the given line is displayed first time
or after it was modified. Otherwise the previously found matches
are used.
* Add UnhighlightSearch action
and add it to the list of actions triggered by Esc key by default.
* Add comment explaining the purpose of search map
* Add hlsearch colors to colorschemes
Mostly just copied from the corresponding original (mostly vim) colorschemes.
* Highlight matches during/after replace as well
As a side effect it also changes the last search value, i.e. affects FindNext
and FindPrevious, but it's probably fine. In vim it works the same way.
* Improve hlsearch option description
* Fix default colors for unconfigured syntax groups
When GetColor is called for a syntax group not specified in the
colorscheme, it should fallback not to the terminal's default colors
(tcell.DefaultColor) but to the colorscheme's defaults (DefStyle)
which may be different from tcell.DefaultColor.
For example, if we are using micro's default colorscheme in a terminal
which uses a black-on-white theme, then dots and commas in Go files
("symbol" syntax group in go.yaml) are displayed black on a dark
background, i.e. barely visible.
* Avoid using terminal's default colors directly
If a syntax group color is set to "default" (which we have for some
syntax groups in some colorschemes), it defaults to the terminal's
default colors (tcell.DefaultColor), which is fine for 16-color
colorschemes but not quite fine for truecolor and 256-color
colorschemes which should not depend on the terminal colors.
It should default to the colorscheme's default (DefStyle) instead.
For example, if we are using micro's default colorscheme in a terminal
which uses a black-on-white theme, then "bool" type in C files
("type.extended" syntax group in c.yaml) is displayed black on a dark
background, i.e. barely visible.
Fix a slight regression after ec3292: when 'make' is run without specifying
a target, it counter-intuitively runs fetch-tags instead of building micro.
Improvements:
- Use proper scope names for better colorization
- Better regex to detect binary, octal, decimal and hexadecimal numbers
- Extend some definitions based on the Vlang docs
Co-authored-by: AAAA <dev@onerbs.com>
Make the regular expression much more precise:
* match literal dots instead of any char (match rc.conf but not rcXconf)
* match special filenames exactly (match PKGBUILD but not myPKGBUILD.something)
Run build-all to update internal/config/runtime.go
closes#2163