The ssh chroma keeps a list of flags whose argument must be skipped, so the
argument is not mistaken for the hostname. Every entry is hyphenated except
two: `Q` and `R` are written bare, so `-Q` and `-R` never match.
For `-R` the consequence is visible. Typing
ssh -R 5037:localhost:5037 devbox
leaves `5037:localhost:5037` counted as the first non-option token, so it
becomes the hostname. Its trailing `:5037` then matches the host:port check and
the chroma calls `zle -M` with
Format of hostname incorrect, use -p to pass port number
while you type, on a command line that is perfectly valid. `-L` is in the list
correctly, so the identical local-forward spec highlights fine and only the
remote forward is affected. `-Q` mislabels its argument as the host in the same
way, without reaching the message.
Adds two tests: `-R` must stay silent, and a hostspec that really does carry a
port must still be reported.
Related to #33, which reports `-LRD` forwarding specs highlighting wrongly;
this fixes the `-R` half.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(chroma/make): huge delay on big units
* fix(fast-make): code-style indentation
* feat(fast-make): allow shared cache
One may enable the shared cache by setting the following prior to
loading the fast-synthax-highlighting module
```sh
typeset -gA FAST_HIGHLIGHT
FAST_HIGHLIGHT[chroma-make-cache-global]=1
```
This new implementation change the way the cached makefile' parsed
content are expired. Prior to this commit, cached item expired after
7s. The new implementation get ride of the timer limit and
replace it with a good old "is my file content's different"
* fix(make): colorize targets from imported make-files
Old behavior use to parse the content of the invoked `Makefile` unit
to define targets.
Such parsing didn't take into account targets from unit imported by the
current (ex: targets defined in files imported such as `import
./targets/help.mk`).
New behavior pass the content of the Makefile unit post lexing (aka
`make -f Makefile -pn` instead of the plain unit.
* Update →chroma/-make.ch
---------
Co-authored-by: Philipp Schmitt <pschmitt@users.noreply.github.com>
`goawk` is a POSIX-compliant AWK interpreter that benefits from the
same highlighting as other AWK interpreters here.
Signed-off-by: Lucas Larson <LucasLarson@riseup.net>
zsh prints an abundance of errors when `setopt nounset` is enabled and
fast-syntax-highlighting is activated (#49). This commit helps to avoid
the unnecessary verbosity.
Signed-off-by: Lucas Larson <LucasLarson@riseup.net>
[F-Sy-H](https://github.com/zdharma-continuum/fast-syntax-highlighting) can recognize and highlight manual subsection suffixes (i.e., `open.2`, `ls.1p`, `printf.3`).
- `man-db` is known to support subsection suffixes
- `mandoc` should not be affected by this commit
`$userdirs` can be pretty huge, and blindly expanding it to match as a regex expression
can be expensive.
Because `$userdirs` is an associative array, leveraging direct member lookup is the optimal method.
$userdirs can be quite huge and blindly expanding it to then match as regexp
can be very expensive. Because $userdirs is an associative array, we can do
a direct member lookup which is much quicker.