Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb67c0b84f | ||
|
|
15d4587514 | ||
|
|
e5a59f6b56 | ||
|
|
b4d882dd59 | ||
|
|
2e95ffc08f | ||
|
|
5dcf0cecd8 | ||
|
|
31250c77bf | ||
|
|
39ab1b7321 | ||
|
|
af0099465f |
55
.travis.yml
55
.travis.yml
@@ -1,55 +0,0 @@
|
||||
language: generic
|
||||
sudo: required
|
||||
|
||||
env:
|
||||
- ZSH=master
|
||||
- ZSH=5.7.1
|
||||
- ZSH=5.7
|
||||
- ZSH=5.6.2
|
||||
- ZSH=5.6.1
|
||||
- ZSH=5.6
|
||||
- ZSH=5.5.1
|
||||
- ZSH=5.5
|
||||
- ZSH=5.4.2
|
||||
- ZSH=5.4.1
|
||||
- ZSH=5.4
|
||||
- ZSH=5.3.1
|
||||
- ZSH=5.3
|
||||
- ZSH=5.2
|
||||
- ZSH=5.1.1
|
||||
- ZSH=5.1
|
||||
- ZSH=5.0.8
|
||||
- ZSH=5.0.7
|
||||
- ZSH=5.0.6
|
||||
- ZSH=5.0.5
|
||||
- ZSH=5.0.4
|
||||
- ZSH=5.0.3
|
||||
- ZSH=5.0.2
|
||||
- ZSH=5.0.1
|
||||
- ZSH=5.0.0
|
||||
- ZSH=4.3.17
|
||||
- ZSH=4.3.16
|
||||
- ZSH=4.3.15
|
||||
- ZSH=4.3.14
|
||||
- ZSH=4.3.13
|
||||
- ZSH=4.3.12
|
||||
- ZSH=4.3.11
|
||||
|
||||
script: docker run -v $PWD:/work -w /work zshusers/zsh:${ZSH} /bin/sh -c 'install_packages make procps && make test'
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
urls:
|
||||
- https://webhooks.gitter.im/e/367e241cdea60cb2070b
|
||||
on_success: change
|
||||
on_failure: always
|
||||
on_start: never
|
||||
irc:
|
||||
channels:
|
||||
- "chat.freenode.net#zsh-syntax-highlighting"
|
||||
on_success: change
|
||||
on_failure: always
|
||||
on_start: never
|
||||
use_notice: true
|
||||
template:
|
||||
- "%{repository}/%{branch}#%{build_number}: %{message} Changes : %{compare_url} | Build : %{build_url}"
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2010-2018 zsh-syntax-highlighting contributors
|
||||
Copyright (c) 2010-2016 zsh-syntax-highlighting contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
|
||||
50
HACKING.md
50
HACKING.md
@@ -11,18 +11,16 @@ The `main` highlighter
|
||||
|
||||
The following function `pz` is useful when working on the `main` highlighting:
|
||||
|
||||
```zsh
|
||||
pq() {
|
||||
pq() {
|
||||
(( $#argv )) || return 0
|
||||
print -r -l -- ${(qqqq)argv}
|
||||
}
|
||||
pz() {
|
||||
}
|
||||
pz() {
|
||||
local arg
|
||||
for arg; do
|
||||
pq ${(z)arg}
|
||||
done
|
||||
}
|
||||
```
|
||||
}
|
||||
|
||||
It prints, for each argument, its token breakdown, similar to how the main
|
||||
loop of the `main` highlighter sees it.
|
||||
@@ -34,47 +32,41 @@ Since the test harness empties `ZSH_HIGHLIGHT_STYLES` and the `brackets`
|
||||
highlighter interrogates `ZSH_HIGHLIGHT_STYLES` to determine how to highlight,
|
||||
tests must set the `bracket-level-#` keys themselves. For example:
|
||||
|
||||
```zsh
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||
|
||||
BUFFER='echo ({x})'
|
||||
BUFFER='echo ({x})'
|
||||
|
||||
expected_region_highlight=(
|
||||
expected_region_highlight=(
|
||||
"6 6 bracket-level-1" # (
|
||||
"7 7 bracket-level-2" # {
|
||||
"9 9 bracket-level-2" # }
|
||||
"10 10 bracket-level-1" # )
|
||||
)
|
||||
```
|
||||
)
|
||||
|
||||
Testing the `pattern` and `regexp` highlighters
|
||||
-----------------------------------------------
|
||||
Testing the `pattern` highlighter
|
||||
---------------------------------
|
||||
|
||||
Because the `pattern` and `regexp` highlighters modifies `region_highlight`
|
||||
directly instead of using `_zsh_highlight_add_highlight`, the test harness
|
||||
cannot get the `ZSH_HIGHLIGHT_STYLES` keys. Therefore, when writing tests, use
|
||||
the style itself as third word (cf. the
|
||||
[documentation for `expected_region_highlight`](docs/highlighters.md)). For example:
|
||||
Because the `pattern` highlighter modifies `region_highlight` directly instead
|
||||
of using `_zsh_highlight_add_highlight`, the test harness cannot get the
|
||||
`ZSH_HIGHLIGHT_STYLES` keys. Therefore, when writing tests, use the style
|
||||
itself as third word (cf. the [documentation for `expected_region_highlight`]
|
||||
(docs/highlighters.md)). For example:
|
||||
|
||||
```zsh
|
||||
ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
|
||||
ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
|
||||
|
||||
BUFFER='rm -rf /'
|
||||
BUFFER='rm -rf /'
|
||||
|
||||
expected_region_highlight=(
|
||||
expected_region_highlight=(
|
||||
"1 8 fg=white,bold,bg=red" # rm -rf /
|
||||
)
|
||||
```
|
||||
)
|
||||
|
||||
Miscellany
|
||||
----------
|
||||
|
||||
If you work on the driver (`zsh-syntax-highlighting.zsh`), you may find the following zstyle useful:
|
||||
|
||||
```zsh
|
||||
zstyle ':completion:*:*:*:*:globbed-files' ignored-patterns {'*/',}zsh-syntax-highlighting.plugin.zsh
|
||||
```
|
||||
zstyle ':completion:*:*:*:*:globbed-files' ignored-patterns {'*/',}zsh-syntax-highlighting.plugin.zsh
|
||||
|
||||
IRC channel
|
||||
-----------
|
||||
|
||||
64
INSTALL.md
64
INSTALL.md
@@ -4,52 +4,34 @@ How to install
|
||||
### Using packages
|
||||
|
||||
* Arch Linux: [community/zsh-syntax-highlighting][arch-package] / [AUR/zsh-syntax-highlighting-git][AUR-package]
|
||||
* Debian: `zsh-syntax-highlighting` package [in `stretch`][debian-package] (or in [OBS repository][obs-repository])
|
||||
* Fedora: [zsh-syntax-highlighting package][fedora-package-alt] in Fedora 24+ (or in [OBS repository][obs-repository])
|
||||
* FreeBSD: `pkg install zsh-syntax-highlighting` (port name: [`textproc/zsh-syntax-highlighting`][freebsd-port])
|
||||
* Debian: `zsh-syntax-highlighting` package [in `stretch`][debian-package]
|
||||
* Gentoo: [mv overlay][gentoo-overlay]
|
||||
* Mac OS X / Homebrew: [brew install zsh-syntax-highlighting][brew-package]
|
||||
* Ubuntu: `zsh-syntax-highlighting` package [in Xenial][ubuntu-package] (or in [OBS repository][obs-repository])
|
||||
* RHEL / CentOS / Scientific Linux: `zsh-syntax-highlighting` package in [OBS repository][obs-repository]
|
||||
* openSUSE / SLE: `zsh-syntax-highlighting` package in [OBS repository][obs-repository]
|
||||
* Void Linux: `zsh-syntax-highlighting package` [in XBPS][void-package]
|
||||
* Ubuntu: `zsh-syntax-highlighting` package [in Xenial][ubuntu-package]
|
||||
|
||||
[arch-package]: https://www.archlinux.org/packages/zsh-syntax-highlighting
|
||||
[AUR-package]: https://aur.archlinux.org/packages/zsh-syntax-highlighting-git
|
||||
[debian-package]: https://packages.debian.org/zsh-syntax-highlighting
|
||||
[freebsd-port]: http://www.freshports.org/textproc/zsh-syntax-highlighting/
|
||||
[gentoo-overlay]: http://gpo.zugaina.org/app-shells/zsh-syntax-highlighting
|
||||
[brew-package]: https://github.com/Homebrew/homebrew-core/blob/master/Formula/zsh-syntax-highlighting.rb
|
||||
[brew-package]: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/zsh-syntax-highlighting.rb
|
||||
[ubuntu-package]: https://launchpad.net/ubuntu/+source/zsh-syntax-highlighting
|
||||
[fedora-package]: https://apps.fedoraproject.org/packages/zsh-syntax-highlighting
|
||||
[fedora-package-alt]: https://bodhi.fedoraproject.org/updates/?packages=zsh-syntax-highlighting
|
||||
[obs-repository]: https://software.opensuse.org//download.html?project=shells%3Azsh-users%3Azsh-syntax-highlighting&package=zsh-syntax-highlighting
|
||||
[void-package]: https://github.com/void-linux/void-packages/tree/master/srcpkgs/zsh-syntax-highlighting
|
||||
|
||||
See also [repology's cross-distro index](https://repology.org/metapackage/zsh-syntax-highlighting/versions)
|
||||
|
||||
|
||||
### In your ~/.zshrc
|
||||
|
||||
Simply clone this repository and source the script:
|
||||
|
||||
```zsh
|
||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
|
||||
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
|
||||
```
|
||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
|
||||
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
|
||||
|
||||
Then, enable syntax highlighting in the current interactive shell:
|
||||
|
||||
```zsh
|
||||
source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
```
|
||||
source ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
|
||||
If `git` is not installed, download and extract a snapshot of the latest
|
||||
development tree from:
|
||||
|
||||
```
|
||||
https://github.com/zsh-users/zsh-syntax-highlighting/archive/master.tar.gz
|
||||
```
|
||||
https://github.com/zsh-users/zsh-syntax-highlighting/archive/master.tar.gz
|
||||
|
||||
Note the `source` command must be **at the end** of `~/.zshrc`.
|
||||
|
||||
@@ -61,10 +43,9 @@ Note that `zsh-syntax-highlighting` must be the last plugin sourced.
|
||||
The zsh-syntax-highlighting authors recommend manual installation over the use
|
||||
of a framework or plugin manager.
|
||||
|
||||
This list is incomplete as there are too many
|
||||
[frameworks / plugin managers][framework-list] to list them all here.
|
||||
|
||||
[framework-list]: https://github.com/unixorn/awesome-zsh-plugins#frameworks
|
||||
This list is incomplete as there are too many [frameworks / plugin managers]
|
||||
(https://github.com/unixorn/awesome-zsh-plugins#frameworks) to list them all
|
||||
here.
|
||||
|
||||
#### [Antigen](https://github.com/zsh-users/antigen)
|
||||
|
||||
@@ -75,24 +56,21 @@ your `.zshrc`.
|
||||
|
||||
1. Clone this repository in oh-my-zsh's plugins directory:
|
||||
|
||||
```zsh
|
||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
||||
```
|
||||
|
||||
2. Activate the plugin in `~/.zshrc`:
|
||||
|
||||
```zsh
|
||||
plugins=( [plugins...] zsh-syntax-highlighting)
|
||||
```
|
||||
|
||||
3. Restart zsh (such as by opening a new instance of your terminal emulator).
|
||||
3. Source `~/.zshrc` to take changes into account:
|
||||
|
||||
source ~/.zshrc
|
||||
|
||||
#### [Prezto](https://github.com/sorin-ionescu/prezto)
|
||||
|
||||
Zsh-syntax-highlighting is included with Prezto. See the
|
||||
[Prezto documentation][prezto-docs] to enable and configure highlighters.
|
||||
|
||||
[prezto-docs]: https://github.com/sorin-ionescu/prezto/tree/master/modules/syntax-highlighting
|
||||
Zsh-syntax-highlighting is included with Prezto. See the [Prezto documentation]
|
||||
(https://github.com/sorin-ionescu/prezto/tree/master/modules/syntax-highlighting)
|
||||
to enable and configure highlighters.
|
||||
|
||||
#### [zgen](https://github.com/tarjoilija/zgen)
|
||||
|
||||
@@ -100,7 +78,7 @@ Add `zgen load zsh-users/zsh-syntax-highlighting` to the end of your `.zshrc`.
|
||||
|
||||
#### [zplug](https://github.com/zplug/zplug)
|
||||
|
||||
Add `zplug "zsh-users/zsh-syntax-highlighting", defer:2` to your `.zshrc`.
|
||||
Add `zplug "zsh-users/zsh-syntax-highlighting", nice:10` to your `.zshrc`.
|
||||
|
||||
#### [zplugin](https://github.com/psprint/zplugin)
|
||||
|
||||
@@ -114,14 +92,10 @@ Any of the above methods is suitable for a single-user installation,
|
||||
which requires no special privileges. If, however, you desire to install
|
||||
zsh-syntax-highlighting system-wide, you may do so by running
|
||||
|
||||
```zsh
|
||||
make install
|
||||
```
|
||||
make install
|
||||
|
||||
and directing your users to add
|
||||
|
||||
```zsh
|
||||
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
```
|
||||
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
|
||||
to their `.zshrc`s.
|
||||
|
||||
2
Makefile
2
Makefile
@@ -17,7 +17,6 @@ install: all
|
||||
$(INSTALL) -d $(DOC_DIR)
|
||||
cp .version zsh-syntax-highlighting.zsh $(SHARE_DIR)
|
||||
cp COPYING.md README.md changelog.md $(DOC_DIR)
|
||||
sed -e '1s/ .*//' -e '/^\[build-status-[a-z]*\]: /d' < README.md > $(DOC_DIR)/README.md
|
||||
if [ x"true" = x"`git rev-parse --is-inside-work-tree 2>/dev/null`" ]; then \
|
||||
git rev-parse HEAD; \
|
||||
else \
|
||||
@@ -36,7 +35,6 @@ clean:
|
||||
rm -f docs/all.md
|
||||
|
||||
test:
|
||||
@$(ZSH) -fc 'echo ZSH_PATCHLEVEL=$$ZSH_PATCHLEVEL'
|
||||
@result=0; \
|
||||
for test in highlighters/*; do \
|
||||
if [ -d $$test/test-data ]; then \
|
||||
|
||||
26
README.md
26
README.md
@@ -1,17 +1,15 @@
|
||||
**This branch will be rebased from time to time.**
|
||||
|
||||
zsh-syntax-highlighting [![Build Status][build-status-image]][build-status-travis]
|
||||
zsh-syntax-highlighting
|
||||
=======================
|
||||
|
||||
**[Fish shell][fish]-like syntax highlighting for [Zsh][zsh].**
|
||||
**[Fish shell][fish]-like like syntax highlighting for [Zsh][zsh].**
|
||||
|
||||
*Requirements: zsh 4.3.11+.*
|
||||
*Requirements: zsh 4.3.17+.*
|
||||
|
||||
[fish]: http://www.fishshell.com/
|
||||
[zsh]: http://www.zsh.org/
|
||||
|
||||
This package provides syntax highlighting for the shell zsh. It enables
|
||||
highlighting of commands whilst they are typed at a zsh prompt into an
|
||||
This package provides syntax highlighing for the shell zsh. It enables
|
||||
highlighing of commands whilst they are typed at a zsh prompt into an
|
||||
interactive terminal. This helps in reviewing commands before running
|
||||
them, particularly in catching syntax errors.
|
||||
|
||||
@@ -48,19 +46,20 @@ syntax highlighting.
|
||||
|
||||
### Does syntax highlighting work during incremental history search?
|
||||
|
||||
Highlighting the command line during an incremental history search (by default bound to
|
||||
to <kbd>Ctrl+R</kbd> in zsh's emacs keymap) requires zsh 5.4 or newer.
|
||||
Highlighting the command line during an incremental history search
|
||||
(with the `history-incremental-search-backward` widget, which is
|
||||
bound by default to <kbd>Ctrl+R</kbd> in zsh's emacs keymap) requires zsh 5.3
|
||||
or newer.
|
||||
|
||||
Under zsh versions older than 5.4, the zsh-default [underlining][zshzle-Character-Highlighting]
|
||||
Under zsh 5.2 and older, the zsh-default [underlining][zshzle-Character-Highlighting]
|
||||
of the matched portion of the buffer remains available, but zsh-syntax-highlighting's
|
||||
additional highlighting is unavailable. (Those versions of zsh do not provide
|
||||
enough information to allow computing the highlighting correctly.)
|
||||
|
||||
See issues [#288][i288] and [#415][i415] for details.
|
||||
See [issue #288][i288] for details.
|
||||
|
||||
[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
|
||||
[i288]: https://github.com/zsh-users/zsh-syntax-highlighting/pull/288
|
||||
[i415]: https://github.com/zsh-users/zsh-syntax-highlighting/pull/415
|
||||
|
||||
### How are new releases announced?
|
||||
|
||||
@@ -77,6 +76,3 @@ How to tweak
|
||||
Syntax highlighting is done by pluggable highlighter scripts. See the
|
||||
[documentation on highlighters](docs/highlighters.md) for details and
|
||||
configuration settings.
|
||||
|
||||
[build-status-image]: https://travis-ci.org/zsh-users/zsh-syntax-highlighting.svg?branch=master
|
||||
[build-status-travis]: https://travis-ci.org/zsh-users/zsh-syntax-highlighting
|
||||
|
||||
130
changelog.md
130
changelog.md
@@ -1,76 +1,4 @@
|
||||
# Changes in version 0.6.0
|
||||
|
||||
This is a stable release, featuring bugfixes and minor improvements.
|
||||
|
||||
|
||||
## Performance improvements:
|
||||
|
||||
(none)
|
||||
|
||||
|
||||
## Added highlighting of:
|
||||
|
||||
- The `isearch` and `suffix` [`$zle_highlight` settings][zshzle-Character-Highlighting].
|
||||
(79e4d3d12405, 15db71abd0cc, b56ee542d619; requires zsh 5.3 for `$ISEARCHMATCH_ACTIVE` / `$SUFFIX_ACTIVE` support)
|
||||
|
||||
[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
|
||||
|
||||
- Possible history expansions in double-quoted strings.
|
||||
(76ea9e1df316)
|
||||
|
||||
- Mismatched `if`/`then`/`elif`/`else`/`fi`.
|
||||
(73cb83270262)
|
||||
|
||||
|
||||
## Fixed highlighting of:
|
||||
|
||||
- A comment line followed by a non-comment line.
|
||||
(#385, 9396ad5c5f9c)
|
||||
|
||||
- An unquoted `$*` (expands to the positional parameters).
|
||||
(237f89ad629f)
|
||||
|
||||
- history-incremental-pattern-search-backward under zsh 5.3.1.
|
||||
(#407, #415, 462779629a0c)
|
||||
|
||||
|
||||
## API changes (for highlighter authors):
|
||||
|
||||
(none)
|
||||
|
||||
|
||||
## Developer-visible changes:
|
||||
|
||||
- tests: Set the `ALIAS_FUNC_DEF` option for zsh 5.4 compatibility.
|
||||
(9523d6d49cb3)
|
||||
|
||||
|
||||
## Other changes:
|
||||
|
||||
- docs: Added before/after screenshots.
|
||||
(cd9ec14a65ec..b7e277106b49)
|
||||
|
||||
- docs: Link Fedora package.
|
||||
(3d74aa47e4a7, 5feed23962df)
|
||||
|
||||
- docs: Link FreeBSD port.
|
||||
(626c034c68d7)
|
||||
|
||||
- docs: Link OpenSUSE Build Service packages
|
||||
(#419, dea1fedc7358)
|
||||
|
||||
- Prevent user-defined aliases from taking effect in z-sy-h's own code.
|
||||
(#390, 2dce602727d7, 8d5afe47f774; and #392, #395, b8fa1b9dc954)
|
||||
|
||||
- docs: Update zplug installation instructions.
|
||||
(#399, 4f49c4a35f17)
|
||||
|
||||
- Improve "unhandled ZLE widget 'foo'" error message.
|
||||
(#409, be083d7f3710)
|
||||
|
||||
- Fix printing of "failed loading highlighters" error message.
|
||||
(#426, ad522a091429)
|
||||
|
||||
up to 0.5.0
|
||||
|
||||
# Changes in version 0.5.0
|
||||
|
||||
@@ -309,66 +237,50 @@ in this area.
|
||||
- incomplete sudo commands
|
||||
(a3047a912100, 2f05620b19ae)
|
||||
|
||||
```zsh
|
||||
sudo;
|
||||
sudo -u;
|
||||
```
|
||||
|
||||
- command words following reserved words
|
||||
(#207, #222, b397b12ac139 et seq, 6fbd2aa9579b et seq, 8b4adbd991b0)
|
||||
|
||||
```zsh
|
||||
if ls; then ls; else ls; fi
|
||||
repeat 10 do ls; done
|
||||
```
|
||||
|
||||
(The `ls` are now highlighted as a command.)
|
||||
|
||||
- comments (when `INTERACTIVE_COMMENTS` is set)
|
||||
(#163, #167, 693de99a9030)
|
||||
|
||||
```zsh
|
||||
echo Hello # comment
|
||||
```
|
||||
|
||||
- closing brackets of arithmetic expansion, subshells, and blocks
|
||||
(#226, a59f442d2d34, et seq)
|
||||
|
||||
```zsh
|
||||
(( foo ))
|
||||
( foo )
|
||||
{ foo }
|
||||
```
|
||||
|
||||
- command names enabled by the `PATH_DIRS` option
|
||||
(#228, 96ee5116b182)
|
||||
|
||||
```zsh
|
||||
# When ~/bin/foo/bar exists, is executable, ~/bin is in $PATH,
|
||||
# and 'setopt PATH_DIRS' is in effect
|
||||
foo/bar
|
||||
```
|
||||
|
||||
- parameter expansions with braces inside double quotes
|
||||
(#186, 6e3720f39d84)
|
||||
|
||||
```zsh
|
||||
echo "${foo}"
|
||||
```
|
||||
|
||||
- parameter expansions in command word
|
||||
(#101, 4fcfb15913a2)
|
||||
|
||||
```zsh
|
||||
x=/bin/ls
|
||||
$x -l
|
||||
```
|
||||
|
||||
- the command separators '\|&', '&!', '&\|'
|
||||
- the command separators '|&', '&!', '&|'
|
||||
|
||||
```zsh
|
||||
view file.pdf &! ls
|
||||
```
|
||||
|
||||
|
||||
## Fixed highlighting of:
|
||||
@@ -376,31 +288,23 @@ in this area.
|
||||
- precommand modifiers at non-command-word position
|
||||
(#209, 2c9f8c8c95fa)
|
||||
|
||||
```zsh
|
||||
ls command foo
|
||||
```
|
||||
|
||||
- sudo commands with infix redirections
|
||||
(#221, be006aded590, 86e924970911)
|
||||
|
||||
```zsh
|
||||
sudo -u >/tmp/foo.out user ls
|
||||
```
|
||||
|
||||
- subshells; anonymous functions
|
||||
(#166, #194, 0d1bfbcbfa67, 9e178f9f3948)
|
||||
|
||||
```zsh
|
||||
(true)
|
||||
() { true }
|
||||
```
|
||||
|
||||
- parameter assignment statements with no command
|
||||
(#205, 01d7eeb3c713)
|
||||
|
||||
```zsh
|
||||
A=1;
|
||||
```
|
||||
|
||||
(The semicolon used to be highlighted as a mistake)
|
||||
|
||||
@@ -491,95 +395,69 @@ in this area.
|
||||
|
||||
- suffix aliases (requires zsh 5.1.1 or newer):
|
||||
|
||||
```zsh
|
||||
alias -s png=display
|
||||
foo.png
|
||||
```
|
||||
|
||||
- prefix redirections:
|
||||
|
||||
```zsh
|
||||
<foo.txt cat
|
||||
```
|
||||
|
||||
- redirection operators:
|
||||
|
||||
```zsh
|
||||
echo > foo.txt
|
||||
```
|
||||
|
||||
- arithmetic evaluations:
|
||||
|
||||
```zsh
|
||||
(( 42 ))
|
||||
```
|
||||
|
||||
- $'' strings, including \x/\octal/\u/\U escapes
|
||||
|
||||
```zsh
|
||||
: $'foo\u0040bar'
|
||||
```
|
||||
|
||||
- multiline strings:
|
||||
|
||||
```zsh
|
||||
% echo "line 1
|
||||
line 2"
|
||||
```
|
||||
|
||||
- string literals that haven't been finished:
|
||||
|
||||
```zsh
|
||||
% echo "Hello, world
|
||||
```
|
||||
|
||||
- command words that involve tilde expansion:
|
||||
|
||||
```zsh
|
||||
% ~/bin/foo
|
||||
```
|
||||
|
||||
|
||||
## Fixed highlighting of:
|
||||
|
||||
- quoted command words:
|
||||
|
||||
```zsh
|
||||
% \ls
|
||||
```
|
||||
|
||||
- backslash escapes in "" strings:
|
||||
|
||||
```zsh
|
||||
% echo "\x41"
|
||||
```
|
||||
|
||||
- noglob after command separator:
|
||||
|
||||
```zsh
|
||||
% :; noglob echo *
|
||||
```
|
||||
|
||||
- glob after command separator, when the first command starts with 'noglob':
|
||||
|
||||
```zsh
|
||||
% noglob true; echo *
|
||||
```
|
||||
|
||||
- the region (vi visual mode / set-mark-command) (issue #165)
|
||||
|
||||
- redirection and command separators that would be highlighted as `path_approx`
|
||||
|
||||
```zsh
|
||||
% echo foo;‸
|
||||
% echo <‸
|
||||
```
|
||||
|
||||
(where `‸` represents the cursor location)
|
||||
|
||||
- escaped globbing (outside quotes)
|
||||
|
||||
```zsh
|
||||
% echo \*
|
||||
```
|
||||
|
||||
|
||||
## Other changes:
|
||||
|
||||
@@ -24,9 +24,7 @@ How to activate highlighters
|
||||
To activate an highlighter, add it to the `ZSH_HIGHLIGHT_HIGHLIGHTERS` array in
|
||||
`~/.zshrc`, for example:
|
||||
|
||||
```zsh
|
||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
|
||||
```
|
||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
|
||||
|
||||
By default, `$ZSH_HIGHLIGHT_HIGHLIGHTERS` is unset and only the `main`
|
||||
highlighter is active.
|
||||
@@ -44,18 +42,6 @@ page][zshzle-Character-Highlighting].
|
||||
|
||||
[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
|
||||
|
||||
Styles may be set directly or by themes. If no theme is specified in
|
||||
`ZSH_HIGHLIGHT_THEME` the `default` theme will be loaded. Additional themes
|
||||
may be layered on top (overriding previous theme's settings) by calling
|
||||
`_zsh_highlight_load_theme`. `_zsh_highlight_load_theme` takes either an
|
||||
absolute path to a theme file to load or a theme name. For a theme name the
|
||||
base theme from the themes directory is loaded and then the extensions of the
|
||||
theme that any active highlighter has are loaded. Names must not contain a `/`.
|
||||
|
||||
The `default` theme is a colorful theme that preserves the defaults the
|
||||
highlighters originally had. The `error-only` theme is also available for
|
||||
highlighting only syntax errors.
|
||||
|
||||
Some highlighters support additional configuration parameters; see each
|
||||
highlighter's documentation for details and examples.
|
||||
|
||||
@@ -72,34 +58,25 @@ To create your own `acme` highlighter:
|
||||
This function must return 0 when the highlighter needs to be called and
|
||||
non-zero otherwise, for example:
|
||||
|
||||
```zsh
|
||||
_zsh_highlight_highlighter_acme_predicate() {
|
||||
# Call this highlighter in SVN working copies
|
||||
[[ -d .svn ]]
|
||||
}
|
||||
```
|
||||
|
||||
* Implement the `_zsh_highlight_highlighter_acme_paint` function.
|
||||
This function does the actual syntax highlighting, by calling
|
||||
`_zsh_highlight_add_highlight` with the start and end of the region to
|
||||
be highlighted and the `ZSH_HIGHLIGHT_STYLES` key to use. The key should
|
||||
be prefixed with your highlighter name and a colon
|
||||
be highlighted and the `ZSH_HIGHLIGHT_STYLES` key to use. Define the default
|
||||
style for that key in the highlighter script outside of any function with
|
||||
`: ${ZSH_HIGHLIGHT_STYLES[key]:=value}`, being sure to prefix
|
||||
the key with your highlighter name and a colon. For example:
|
||||
|
||||
: ${ZSH_HIGHLIGHT_STYLES[acme:aurora]:=fg=green}
|
||||
|
||||
_zsh_highlight_highlighter_acme_paint() {
|
||||
# Colorize the whole buffer with the 'aurora' style
|
||||
_zsh_highlight_add_highlight 0 $#BUFFER acme:aurora
|
||||
}
|
||||
```
|
||||
|
||||
If you need to test which options the user has set, test `zsyh_user_options`
|
||||
with a sensible default if the option is not present in supported zsh
|
||||
versions. For example:
|
||||
|
||||
```zsh
|
||||
[[ ${zsyh_user_options[ignoreclosebraces]:-off} == on ]]
|
||||
```
|
||||
|
||||
The option name must be all lowercase with no underscores and not an alias.
|
||||
|
||||
* Name your own functions and global variables `_zsh_highlight_acme_*`.
|
||||
|
||||
@@ -113,19 +90,8 @@ To create your own `acme` highlighter:
|
||||
These names are still supported for backwards compatibility;
|
||||
however, support for them will be removed in a a future major or minor release (v0.x.0 or v1.0.0).
|
||||
|
||||
* Optionally extended the built-in themes in
|
||||
`highlighters/${myhighlighter}/themes/${themename}`.
|
||||
|
||||
Define the theme's style for that key with `ZSH_HIGHLIGHT_STYLES[key]=value`,
|
||||
being sure to prefix the key with your highlighter name and a colon. For
|
||||
example:
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[myhighlighter:aurora]=fg=green
|
||||
|
||||
* Activate your highlighter in `~/.zshrc`:
|
||||
|
||||
```zsh
|
||||
ZSH_HIGHLIGHT_HIGHLIGHTERS+=(acme)
|
||||
```
|
||||
|
||||
* [Write tests](../tests/README.md).
|
||||
|
||||
@@ -16,13 +16,11 @@ This highlighter defines the following styles:
|
||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,
|
||||
for example in `~/.zshrc`:
|
||||
|
||||
```zsh
|
||||
# To define styles for nested brackets up to level 4
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=blue,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-2]='fg=red,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-3]='fg=yellow,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-4]='fg=magenta,bold'
|
||||
```
|
||||
# To define styles for nested brackets up to level 4
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=blue,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-2]='fg=red,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-3]='fg=yellow,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-4]='fg=magenta,bold'
|
||||
|
||||
The syntax for values is the same as the syntax of "types of highlighting" of
|
||||
the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`
|
||||
|
||||
@@ -13,9 +13,7 @@ This highlighter defines the following styles:
|
||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,
|
||||
for example in `~/.zshrc`:
|
||||
|
||||
```zsh
|
||||
ZSH_HIGHLIGHT_STYLES[cursor]='bg=blue'
|
||||
```
|
||||
ZSH_HIGHLIGHT_STYLES[cursor]='bg=blue'
|
||||
|
||||
The syntax for values is the same as the syntax of "types of highlighting" of
|
||||
the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`
|
||||
|
||||
@@ -13,9 +13,7 @@ This highlighter defines the following styles:
|
||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,
|
||||
for example in `~/.zshrc`:
|
||||
|
||||
```zsh
|
||||
ZSH_HIGHLIGHT_STYLES[line]='bold'
|
||||
```
|
||||
ZSH_HIGHLIGHT_STYLES[line]='bold'
|
||||
|
||||
The syntax for values is the same as the syntax of "types of highlighting" of
|
||||
the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`
|
||||
|
||||
@@ -32,66 +32,40 @@ This highlighter defines the following styles:
|
||||
* `path_prefix_pathseparator` - path separators in prefixes of existing filenames (`/`); if unset, `path_prefix` is used (default)
|
||||
* `globbing` - globbing expressions (`*.txt`)
|
||||
* `history-expansion` - history expansion expressions (`!foo` and `^foo^bar`)
|
||||
* `command-substitution` - command substitutions (`$(echo foo)`)
|
||||
* `command-substitution-unquoted` - an unquoted command substitution (`$(echo foo)`)
|
||||
* `command-substitution-quoted` - a quoted command substitution (`"$(echo foo)"`)
|
||||
* `command-substitution-delimiter` - command substitution delimiters (`$(` and `)`)
|
||||
* `command-substitution-delimiter-unquoted` - an unquoted command substitution delimiters (`$(` and `)`)
|
||||
* `command-substitution-delimiter-quoted` - a quoted command substitution delimiters (`"$(` and `)"`)
|
||||
* `process-substitution` - process substitutions (`<(echo foo)`)
|
||||
* `process-substitution-delimiter` - process substitution delimiters (`<(` and `)`)
|
||||
* `single-hyphen-option` - single-hyphen options (`-o`)
|
||||
* `double-hyphen-option` - double-hyphen options (`--option`)
|
||||
* `back-quoted-argument` - backtick command substitution (`` `foo` ``)
|
||||
* `back-quoted-argument-unclosed` - unclosed backtick command substitution (`` `foo ``)
|
||||
* `back-quoted-argument-delimiter` - backtick command substitution delimiters (`` ` ``)
|
||||
* `single-quoted-argument` - single-quoted arguments (`` 'foo' ``)
|
||||
* `single-quoted-argument-unclosed` - unclosed single-quoted arguments (`` 'foo ``)
|
||||
* `double-quoted-argument` - double-quoted arguments (`` "foo" ``)
|
||||
* `double-quoted-argument-unclosed` - unclosed double-quoted arguments (`` "foo ``)
|
||||
* `dollar-quoted-argument` - dollar-quoted arguments (`` $'foo' ``)
|
||||
* `dollar-quoted-argument-unclosed` - unclosed dollar-quoted arguments (`` $'foo ``)
|
||||
* `rc-quote` - two single quotes inside single quotes when the `RC_QUOTES` option is set (`` 'foo''bar' ``)
|
||||
* `single-hyphen-option` - single hyphen options (`-o`)
|
||||
* `double-hyphen-option` - double hyphen options (`--option`)
|
||||
* `back-quoted-argument` - backquoted expressions (`` `foo` ``)
|
||||
* `single-quoted-argument` - single quoted arguments (`` 'foo' ``)
|
||||
* `double-quoted-argument` - double quoted arguments (`` "foo" ``)
|
||||
* `dollar-quoted-argument` - dollar quoted arguments (`` $'foo' ``)
|
||||
* `dollar-double-quoted-argument` - parameter expansion inside double quotes (`$foo` inside `""`)
|
||||
* `back-double-quoted-argument` - backslash escape sequences inside double-quoted arguments (`\"` in `"foo\"bar"`)
|
||||
* `back-dollar-quoted-argument` - backslash escape sequences inside dollar-quoted arguments (`\x` in `$'\x48'`)
|
||||
* `assign` - parameter assignments (`x=foo` and `x=( )`)
|
||||
* `back-double-quoted-argument` - back double quoted arguments (`\x` inside `""`)
|
||||
* `back-dollar-quoted-argument` - back dollar quoted arguments (`\x` inside `$''`)
|
||||
* `assign` - parameter assignments
|
||||
* `redirection` - redirection operators (`<`, `>`, etc)
|
||||
* `comment` - comments, when `setopt INTERACTIVE_COMMENTS` is in effect (`echo # foo`)
|
||||
* `named-fd` - named file descriptor (`echo foo {fd}>&2`)
|
||||
* `arg0` - a command word other than one of those enumerated above (other than a command, precommand, alias, function, or shell builtin command).
|
||||
* `arg0` - a command word other than one of those enumrated above (other than a command, precommand, alias, function, or shell builtin command).
|
||||
* `default` - everything else
|
||||
|
||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,
|
||||
for example in `~/.zshrc`:
|
||||
|
||||
```zsh
|
||||
# Declare the variable
|
||||
typeset -A ZSH_HIGHLIGHT_STYLES
|
||||
# Declare the variable
|
||||
typeset -A ZSH_HIGHLIGHT_STYLES
|
||||
|
||||
# To differentiate aliases from other command types
|
||||
ZSH_HIGHLIGHT_STYLES[alias]='fg=magenta,bold'
|
||||
# To differentiate aliases from other command types
|
||||
ZSH_HIGHLIGHT_STYLES[alias]='fg=magenta,bold'
|
||||
|
||||
# To have paths colored instead of underlined
|
||||
ZSH_HIGHLIGHT_STYLES[path]='fg=cyan'
|
||||
# To have paths colored instead of underlined
|
||||
ZSH_HIGHLIGHT_STYLES[path]='fg=cyan'
|
||||
|
||||
# To disable highlighting of globbing expressions
|
||||
ZSH_HIGHLIGHT_STYLES[globbing]='none'
|
||||
```
|
||||
# To disable highlighting of globbing expressions
|
||||
ZSH_HIGHLIGHT_STYLES[globbing]='none'
|
||||
|
||||
The syntax for values is the same as the syntax of "types of highlighting" of
|
||||
the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`
|
||||
manual page][zshzle-Character-Highlighting].
|
||||
|
||||
#### Parameters
|
||||
|
||||
To avoid partial path lookups on a path, add the path to the `X_ZSH_HIGHLIGHT_DIRS_BLACKLIST` array.
|
||||
This interface is still experimental.
|
||||
|
||||
```zsh
|
||||
X_ZSH_HIGHLIGHT_DIRS_BLACKLIST+=(/mnt/slow_share)
|
||||
```
|
||||
|
||||
### Useless trivia
|
||||
|
||||
#### Forward compatibility.
|
||||
|
||||
@@ -9,13 +9,8 @@ This is the `pattern` highlighter, that highlights user-defined patterns.
|
||||
To use this highlighter, associate patterns with styles in the
|
||||
`ZSH_HIGHLIGHT_PATTERNS` associative array, for example in `~/.zshrc`:
|
||||
|
||||
```zsh
|
||||
# Declare the variable
|
||||
typeset -A ZSH_HIGHLIGHT_PATTERNS
|
||||
|
||||
# To have commands starting with `rm -rf` in red:
|
||||
ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
|
||||
```
|
||||
# To have commands starting with `rm -rf` in red:
|
||||
ZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')
|
||||
|
||||
The syntax for values is the same as the syntax of "types of highlighting" of
|
||||
the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
zsh-syntax-highlighting / highlighters / regexp
|
||||
------------------------------------------------
|
||||
|
||||
This is the `regexp` highlighter, that highlights user-defined regular
|
||||
expressions. It's similar to the `pattern` highlighter, but allows more complex
|
||||
patterns.
|
||||
|
||||
### How to tweak it
|
||||
|
||||
To use this highlighter, associate regular expressions with styles in the
|
||||
`ZSH_HIGHLIGHT_REGEXP` associative array, for example in `~/.zshrc`:
|
||||
|
||||
```zsh
|
||||
typeset -A ZSH_HIGHLIGHT_PATTERNS
|
||||
ZSH_HIGHLIGHT_REGEXP+=('\bsudo\b' fg=123,bold)
|
||||
```
|
||||
|
||||
This will highlight "sudo" only as a complete word, i.e., "sudo cmd", but not
|
||||
"sudoedit"
|
||||
|
||||
The syntax for values is the same as the syntax of "types of highlighting" of
|
||||
the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`
|
||||
manual page][zshzle-Character-Highlighting].
|
||||
|
||||
See also: [regular expressions tutorial][perlretut], zsh regexp operator `=~`
|
||||
in [the `zshmisc(1)` manual page][zshmisc-Conditional-Expressions]
|
||||
|
||||
[zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
|
||||
[perlretut]: http://perldoc.perl.org/perlretut.html
|
||||
[zshmisc-Conditional-Expressions]: http://zsh.sourceforge.net/Doc/Release/Conditional-Expressions.html#Conditional-Expressions
|
||||
@@ -14,9 +14,7 @@ This highlighter defines the following styles:
|
||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,
|
||||
for example in `~/.zshrc`:
|
||||
|
||||
```zsh
|
||||
ZSH_HIGHLIGHT_STYLES[root]='bg=red'
|
||||
```
|
||||
ZSH_HIGHLIGHT_STYLES[root]='bg=red'
|
||||
|
||||
The syntax for values is the same as the syntax of "types of highlighting" of
|
||||
the zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2010-2017 zsh-syntax-highlighting contributors
|
||||
# Copyright (c) 2010-2016 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
@@ -28,6 +28,15 @@
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# Define default styles.
|
||||
: ${ZSH_HIGHLIGHT_STYLES[bracket-error]:=fg=red,bold}
|
||||
: ${ZSH_HIGHLIGHT_STYLES[bracket-level-1]:=fg=blue,bold}
|
||||
: ${ZSH_HIGHLIGHT_STYLES[bracket-level-2]:=fg=green,bold}
|
||||
: ${ZSH_HIGHLIGHT_STYLES[bracket-level-3]:=fg=magenta,bold}
|
||||
: ${ZSH_HIGHLIGHT_STYLES[bracket-level-4]:=fg=yellow,bold}
|
||||
: ${ZSH_HIGHLIGHT_STYLES[bracket-level-5]:=fg=cyan,bold}
|
||||
: ${ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]:=standout}
|
||||
|
||||
# Whether the brackets highlighter should be called or not.
|
||||
_zsh_highlight_highlighter_brackets_predicate()
|
||||
{
|
||||
@@ -50,16 +59,16 @@ _zsh_highlight_highlighter_brackets_paint()
|
||||
lastoflevel[$level]=$pos
|
||||
;;
|
||||
[")]}"])
|
||||
if (( level > 0 )); then
|
||||
matchingpos=$lastoflevel[$level]
|
||||
levelpos[$pos]=$((level--))
|
||||
if _zsh_highlight_brackets_match $matchingpos $pos; then
|
||||
matching[$matchingpos]=$pos
|
||||
matching[$pos]=$matchingpos
|
||||
fi
|
||||
else
|
||||
levelpos[$pos]=-1
|
||||
fi
|
||||
;;
|
||||
['"'\'])
|
||||
# Skip everything inside quotes
|
||||
pos=$BUFFER[(ib:pos+1:)$char]
|
||||
;;
|
||||
esac
|
||||
done
|
||||
@@ -68,17 +77,18 @@ _zsh_highlight_highlighter_brackets_paint()
|
||||
for pos in ${(k)levelpos}; do
|
||||
if (( $+matching[$pos] )); then
|
||||
if (( bracket_color_size )); then
|
||||
_zsh_highlight_add_highlight $((pos - 1)) $pos bracket-level-$(( (levelpos[$pos] - 1) % bracket_color_size + 1 ))
|
||||
style=bracket-level-$(( (levelpos[$pos] - 1) % bracket_color_size + 1 ))
|
||||
fi
|
||||
else
|
||||
_zsh_highlight_add_highlight $((pos - 1)) $pos bracket-error
|
||||
style=bracket-error
|
||||
fi
|
||||
_zsh_highlight_add_highlight $((pos - 1)) $pos $style
|
||||
done
|
||||
|
||||
# If cursor is on a bracket, then highlight corresponding bracket, if any.
|
||||
if [[ $WIDGET != zle-line-finish ]]; then
|
||||
pos=$((CURSOR + 1))
|
||||
if (( $+levelpos[$pos] )) && (( $+matching[$pos] )); then
|
||||
if [[ -n $levelpos[$pos] ]] && [[ -n $matching[$pos] ]]; then
|
||||
local -i otherpos=$matching[$pos]
|
||||
_zsh_highlight_add_highlight $((otherpos - 1)) $otherpos cursor-matchingbracket
|
||||
fi
|
||||
|
||||
@@ -33,4 +33,5 @@ BUFFER=': $foo[bar]'
|
||||
CURSOR=6 # cursor is zero-based
|
||||
|
||||
expected_region_highlight=(
|
||||
"11 11 NONE"
|
||||
)
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
unsorted=1
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-3]=
|
||||
@@ -37,11 +35,5 @@ BUFFER=': ((( )))'
|
||||
CURSOR=2 # cursor is zero-based
|
||||
|
||||
expected_region_highlight=(
|
||||
"3 3 bracket-level-1"
|
||||
"4 4 bracket-level-2"
|
||||
"5 5 bracket-level-3"
|
||||
"7 7 bracket-level-3"
|
||||
"8 8 bracket-level-2"
|
||||
"9 9 bracket-level-1"
|
||||
"9 9 cursor-matchingbracket"
|
||||
)
|
||||
|
||||
@@ -30,4 +30,5 @@
|
||||
BUFFER=': (x)'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 5 NONE"
|
||||
)
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
unsorted=1
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-3]=
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
unsorted=1
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||
|
||||
|
||||
@@ -27,16 +27,12 @@
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
unsorted=1
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||
|
||||
BUFFER=': {"{x}"}'
|
||||
|
||||
expected_region_highlight=(
|
||||
"3 3 bracket-level-1"
|
||||
"5 5 bracket-level-2"
|
||||
"7 7 bracket-level-2"
|
||||
"4 8 NONE"
|
||||
"9 9 bracket-level-1"
|
||||
)
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
unsorted=1
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-3]=
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
HOME="."
|
||||
BUFFER='ls \~'
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||
|
||||
BUFFER=': "\"{x"'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 2 command" # ls
|
||||
"4 5 default" # \~
|
||||
"3 9 NONE 'issue #303'"
|
||||
)
|
||||
@@ -1,34 +0,0 @@
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2017 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER=': x)'
|
||||
|
||||
expected_region_highlight=(
|
||||
"4 4 bracket-error" # )
|
||||
)
|
||||
@@ -30,5 +30,5 @@
|
||||
BUFFER='echo "foo ( bar"'
|
||||
|
||||
expected_region_highlight=(
|
||||
"11 11 bracket-error"
|
||||
"1 16 NONE" # We expect the brackets highlighter to do nothing
|
||||
)
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
unsorted=1
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
unsorted=1
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-2]=
|
||||
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
unsorted=1
|
||||
|
||||
ZSH_HIGHLIGHT_STYLES[bracket-level-1]=
|
||||
|
||||
BUFFER='echo {x})'
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# Define default styles.
|
||||
: ${ZSH_HIGHLIGHT_STYLES[cursor]:=standout}
|
||||
|
||||
# Whether the cursor highlighter should be called or not.
|
||||
_zsh_highlight_highlighter_cursor_predicate()
|
||||
{
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# Define default styles.
|
||||
: ${ZSH_HIGHLIGHT_STYLES[line]:=}
|
||||
|
||||
# Whether the root highlighter should be called or not.
|
||||
_zsh_highlight_highlighter_line_predicate()
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,5 +34,4 @@ BUFFER='x=y ls'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 3 unknown-token" # x=y
|
||||
"5 6 default" # ls
|
||||
)
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
# see alias-comment2.zsh
|
||||
setopt interactivecomments
|
||||
alias x=$'# foo\npwd'
|
||||
BUFFER='x'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 alias "issue #616"' # x
|
||||
)
|
||||
@@ -1,37 +0,0 @@
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
# see alias-comment1.zsh
|
||||
setopt NO_interactivecomments
|
||||
alias x=$'# foo\npwd'
|
||||
BUFFER='x'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 unknown-token' # x (#)
|
||||
)
|
||||
@@ -1,38 +0,0 @@
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
alias x='echo && ls; >'
|
||||
|
||||
BUFFER='x file echo'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 alias' # x
|
||||
'3 6 default' # file
|
||||
'8 11 builtin' # echo
|
||||
)
|
||||
@@ -1,38 +0,0 @@
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
alias x=''
|
||||
|
||||
BUFFER='x echo foo'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 alias' # x
|
||||
'3 6 builtin' # echo
|
||||
'8 10 default' # foo
|
||||
)
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
alias a=b b=c c=b
|
||||
|
||||
BUFFER='a foo; :'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 unknown-token' # a (invalid alias loop)
|
||||
'3 5 default' # foo
|
||||
'6 6 commandseparator' # ;
|
||||
'8 8 builtin' # :
|
||||
)
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
alias a=b b=sudo
|
||||
sudo(){}
|
||||
|
||||
BUFFER='a -u phy1729 echo; :'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 alias' # a
|
||||
'3 4 single-hyphen-option' # -u
|
||||
'6 12 default' # phy1729
|
||||
'14 17 builtin' # echo
|
||||
'18 18 commandseparator' # ;
|
||||
'20 20 builtin' # :
|
||||
)
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
alias a=b b=:
|
||||
|
||||
BUFFER='a foo; :'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 alias' # a
|
||||
'3 5 default' # foo
|
||||
'6 6 commandseparator' # ;
|
||||
'8 8 builtin' # :
|
||||
)
|
||||
@@ -1,41 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
alias sudo_u='sudo -u'
|
||||
sudo(){}
|
||||
|
||||
BUFFER='sudo_u phy1729 echo foo'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 6 alias' # sudo_u
|
||||
'8 14 default' # phy1729
|
||||
'17 19 command "issue #540"' # echo (not builtin)
|
||||
'21 23 default' # foo
|
||||
)
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
alias sudo_b='sudo -b'
|
||||
alias sudo_b_u='sudo_b -u'
|
||||
sudo(){}
|
||||
|
||||
BUFFER='sudo_b_u phy1729 echo foo'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 8 alias' # sudo_b_u
|
||||
'10 16 default' # phy1729
|
||||
'18 21 command "issue #540"' # echo (not builtin)
|
||||
'23 25 default' # foo
|
||||
)
|
||||
@@ -1,41 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2019 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
alias sudo_u='sudo -u'
|
||||
sudo(){}
|
||||
|
||||
BUFFER='sudo_u phy1729 ls foo'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 6 alias' # sudo_u
|
||||
'8 14 default' # phy1729
|
||||
'16 17 command' # ls
|
||||
'19 21 default' # foo
|
||||
)
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
alias sudo_b='sudo -b'
|
||||
alias sudo_b_u='sudo_b -u'
|
||||
sudo(){}
|
||||
|
||||
BUFFER='sudo_b_u phy1729 ls foo'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 8 alias' # sudo_b_u
|
||||
'10 16 default' # phy1729
|
||||
'18 19 command' # ls
|
||||
'21 23 default' # foo
|
||||
)
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) YYYY zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
alias a=: ls='ls -l'
|
||||
BUFFER='"a" foo; \ls'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 3 unknown-token' # "a"
|
||||
'5 7 default' # foo
|
||||
'8 8 commandseparator' # ;
|
||||
'10 12 command' # \ls
|
||||
)
|
||||
@@ -1,38 +0,0 @@
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
alias x=\>
|
||||
BUFFER='x foo echo bar'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 alias' # x
|
||||
'3 5 default' # foo
|
||||
'7 10 builtin' # echo
|
||||
'12 14 default' # bar
|
||||
)
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
alias echo='echo foo'
|
||||
|
||||
BUFFER='echo bar'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 4 alias' # echo
|
||||
'6 8 default' # bar
|
||||
)
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
alias x=/
|
||||
BUFFER=$'x'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 unknown-token "issue #202"' # x (/)
|
||||
)
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2019 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
alias a=b b=foo
|
||||
|
||||
BUFFER='a '
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 unknown-token' # a
|
||||
)
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2019 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
alias a='() { ls "$@" ; foo }'
|
||||
|
||||
BUFFER='a '
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 unknown-token' # a
|
||||
)
|
||||
@@ -27,11 +27,11 @@
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
alias alias1="ls"
|
||||
alias alias1="unused expansion"
|
||||
alias -s alias2="echo"
|
||||
function alias1() {} # to check that it's highlighted as an alias, not as a function
|
||||
alias1() {} # to check that it's highlighted as an alias, not as a function
|
||||
|
||||
BUFFER='x.alias2; alias1; alias2'
|
||||
BUFFER='x.alias2; alias1'
|
||||
|
||||
# Set expected_region_highlight as a function of zsh version.
|
||||
#
|
||||
@@ -40,14 +40,11 @@ BUFFER='x.alias2; alias1; alias2'
|
||||
# functionality is present, and skip verifying suffix-alias highlighting
|
||||
# if it isn't.
|
||||
expected_region_highlight=()
|
||||
if zmodload -e zsh/parameter || [[ "$(type -w x.alias2)" == *suffix* ]]; then
|
||||
if [[ "$(type -w x.alias2)" == *suffix* ]]; then
|
||||
expected_region_highlight+=(
|
||||
"1 8 suffix-alias" # x.alias2
|
||||
)
|
||||
fi
|
||||
expected_region_highlight+=(
|
||||
"9 9 commandseparator" # ;
|
||||
"11 16 alias" # alias1
|
||||
"17 17 commandseparator" # ;
|
||||
"19 24 unknown-token" # alias2
|
||||
)
|
||||
|
||||
@@ -37,8 +37,5 @@ expected_region_highlight=(
|
||||
"16 17 reserved-word" # ()
|
||||
"19 19 reserved-word" # {
|
||||
"21 24 builtin" # echo
|
||||
"26 30 default" # world
|
||||
"32 32 reserved-word" # }
|
||||
"34 43 default" # "argument"
|
||||
"34 43 double-quoted-argument" # "argument"
|
||||
)
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER=''\''x: /'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 5 unknown-token' # \'x: /
|
||||
)
|
||||
@@ -31,7 +31,4 @@ BUFFER='a+=(lorem ipsum)'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 4 assign" # a+=(
|
||||
"5 9 default" # lorem
|
||||
"11 15 default" # ipsum
|
||||
"16 16 assign" # )
|
||||
)
|
||||
|
||||
@@ -27,12 +27,9 @@
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
touch foo
|
||||
BUFFER='42=foo 43+=bar'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 6 assign" # 42=foo
|
||||
"4 6 path" # foo
|
||||
"8 14 assign" # 43+=bar
|
||||
"12 14 default" # bar
|
||||
)
|
||||
|
||||
@@ -32,8 +32,6 @@ BUFFER='(A=(hello world))'
|
||||
expected_region_highlight=(
|
||||
"1 1 reserved-word" # (
|
||||
"2 4 assign" # A=(
|
||||
"5 9 default" # hello
|
||||
"11 15 default" # world
|
||||
"16 16 assign" # )
|
||||
"17 17 reserved-word" # )
|
||||
)
|
||||
|
||||
@@ -31,8 +31,6 @@ BUFFER='A=(hello world) ls'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 3 assign" # A=(
|
||||
"4 8 default" # hello
|
||||
"10 14 default" # world
|
||||
"15 15 assign" # )
|
||||
"17 18 command" # ls
|
||||
)
|
||||
|
||||
@@ -31,9 +31,6 @@ BUFFER='A=(hello world) b=42'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 3 assign" # A=(
|
||||
"4 8 default" # hello
|
||||
"10 14 default" # world
|
||||
"15 15 assign" # )
|
||||
"17 20 assign" # b=42
|
||||
"19 20 default" # 42
|
||||
)
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER='a=foo( bar ) :'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 12 assign' # a=foo( bar )
|
||||
'3 12 default' # foo( bar )
|
||||
'14 14 builtin' # :
|
||||
)
|
||||
@@ -1,36 +0,0 @@
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER='a=foo\( :'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 7 assign' # a=foo\(
|
||||
'3 7 default' # foo\(
|
||||
'9 9 builtin' # :
|
||||
)
|
||||
@@ -30,10 +30,6 @@
|
||||
BUFFER='A=1; echo hello world'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 3 assign" # A=1
|
||||
"3 3 default" # 1
|
||||
"4 4 commandseparator" # ;
|
||||
"6 9 builtin" # echo
|
||||
"11 15 default" # hello
|
||||
"17 21 default" # world
|
||||
)
|
||||
|
||||
@@ -32,6 +32,5 @@ BUFFER='(A=1)'
|
||||
expected_region_highlight=(
|
||||
"1 1 reserved-word" # (
|
||||
"2 4 assign" # A=1
|
||||
"4 4 default" # 1
|
||||
"5 5 reserved-word" # )
|
||||
)
|
||||
|
||||
@@ -31,9 +31,7 @@ BUFFER='A=1 b=("foo" bar)'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 3 assign" # A=1
|
||||
"3 3 default" # 1
|
||||
"5 7 assign" # b=(
|
||||
"8 12 default" # "foo"
|
||||
"8 12 double-quoted-argument" # "foo"
|
||||
"14 16 default" # bar
|
||||
"17 17 assign" # )
|
||||
|
||||
@@ -27,32 +27,8 @@
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER='echo `echo \`42\`` "is `echo equal` to" `echo 6 times 9'
|
||||
BUFFER='echo `echo 42`'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 4 builtin" # echo
|
||||
"6 18 default" # `echo \`42\``
|
||||
"6 18 back-quoted-argument" # `echo \`42\``
|
||||
"6 6 back-quoted-argument-delimiter" # `
|
||||
"7 10 builtin" # echo
|
||||
"12 17 default" # \`42\`
|
||||
"12 17 back-quoted-argument" # \`42\`
|
||||
"12 13 back-quoted-argument-delimiter" # \`
|
||||
"14 15 unknown-token" # 42
|
||||
"16 17 back-quoted-argument-delimiter" # \`
|
||||
"18 18 back-quoted-argument-delimiter" # `
|
||||
"20 39 default" # "is `echo equal` to"
|
||||
"20 39 double-quoted-argument" # "is `echo equal` to"
|
||||
"24 35 back-quoted-argument" # `echo equal`
|
||||
"24 24 back-quoted-argument-delimiter" # `
|
||||
"25 28 builtin" # echo
|
||||
"30 34 default" # equal
|
||||
"35 35 back-quoted-argument-delimiter" # `
|
||||
"41 55 default" # `echo 6 times 9
|
||||
"41 55 back-quoted-argument-unclosed" # `echo 6 times 9
|
||||
"41 41 back-quoted-argument-delimiter" # `
|
||||
"42 45 builtin" # echo
|
||||
"47 47 default" # 6
|
||||
"49 53 default" # times
|
||||
"55 55 default" # 9
|
||||
"6 14 back-quoted-argument"
|
||||
)
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
touch foo
|
||||
BUFFER=$': `ls fo'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 builtin' # :
|
||||
'3 8 default' # `ls fo
|
||||
'3 8 back-quoted-argument-unclosed' # `ls fo
|
||||
'3 3 back-quoted-argument-delimiter' # `
|
||||
'4 5 command' # ls
|
||||
'7 8 path_prefix' # fo
|
||||
)
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER=$'echo \\ \'foo\' ; ls'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 4 builtin' # echo
|
||||
'6 12 default' # \ \'foo\'
|
||||
'8 12 single-quoted-argument' # 'foo'
|
||||
'14 14 commandseparator' # ;
|
||||
'16 17 command' # ls
|
||||
)
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER=$'foo=(bar abaz) \! ls'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 5 assign' # foo=(
|
||||
'6 8 default' # bar
|
||||
'10 13 default' # abaz
|
||||
'14 14 assign' # )
|
||||
'16 16 unknown-token' # \!
|
||||
'18 19 command' # ls
|
||||
)
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER=$'foo=bar \! ls'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 7 assign' # foo=bar
|
||||
'5 7 default' # bar
|
||||
'9 9 unknown-token' # \!
|
||||
'11 12 command' # ls
|
||||
)
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER=$'\! ls | \! ls'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 reserved-word' # \!
|
||||
'3 4 command' # ls
|
||||
'6 6 commandseparator' # |
|
||||
'8 8 unknown-token' # \!
|
||||
'10 11 command' # ls
|
||||
)
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER='[[ -n foo ]]'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 2 reserved-word' # [[
|
||||
'4 5 single-hyphen-option' # -n
|
||||
'7 9 default' # foo
|
||||
'11 12 reserved-word' # ]]
|
||||
)
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER='[ -n foo ]'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 builtin' # [
|
||||
'3 4 single-hyphen-option' # -n
|
||||
'6 8 default' # foo
|
||||
'10 10 builtin' # ]
|
||||
)
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2017 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER='elif true; then echo two; fi'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 4 unknown-token' # elif
|
||||
'6 9 builtin' # true
|
||||
'10 10 commandseparator' # ;
|
||||
'12 15 unknown-token' # then
|
||||
'17 20 builtin' # echo
|
||||
'22 24 default' # two
|
||||
'25 25 commandseparator' # ;
|
||||
'27 28 unknown-token' # fi
|
||||
)
|
||||
@@ -34,7 +34,6 @@ expected_region_highlight=(
|
||||
'1 3 reserved-word' # for
|
||||
'5 5 default' # n
|
||||
'7 8 default' # in
|
||||
'10 10 default' # *
|
||||
'10 10 globbing' # *
|
||||
'11 11 commandseparator' # ;
|
||||
'13 14 reserved-word' # do
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2017 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER='if false; then echo one; elif true; then echo two; else echo three; fi'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 2 reserved-word' # if
|
||||
'4 8 builtin' # false
|
||||
'9 9 commandseparator' # ;
|
||||
'11 14 reserved-word' # then
|
||||
'16 19 builtin' # echo
|
||||
'21 23 default' # one
|
||||
'24 24 commandseparator' # ;
|
||||
'26 29 reserved-word' # elif
|
||||
'31 34 builtin' # true
|
||||
'35 35 commandseparator' # ;
|
||||
'37 40 reserved-word' # then
|
||||
'42 45 builtin' # echo
|
||||
'47 49 default' # two
|
||||
'50 50 commandseparator' # ;
|
||||
'52 55 reserved-word' # else
|
||||
'57 60 builtin' # echo
|
||||
'62 66 default' # three
|
||||
'67 67 commandseparator' # ;
|
||||
'69 70 reserved-word' # fi
|
||||
)
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2017 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER='if false; then echo one; fi'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 2 reserved-word' # if
|
||||
'4 8 builtin' # false
|
||||
'9 9 commandseparator' # ;
|
||||
'11 14 reserved-word' # then
|
||||
'16 19 builtin' # echo
|
||||
'21 23 default' # one
|
||||
'24 24 commandseparator' # ;
|
||||
'26 27 reserved-word' # fi
|
||||
)
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER='[[ -n foo; echo ]]'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 2 reserved-word' # [[
|
||||
'4 5 single-hyphen-option' # -n
|
||||
'7 9 default' # foo
|
||||
'10 10 unknown-token' # ;
|
||||
'12 15 builtin' # echo
|
||||
'17 18 default' # ]]
|
||||
)
|
||||
@@ -1,45 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2019 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER='echo "$(echo)$(echo)'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 4 builtin' # echo
|
||||
'6 20 default' # "$(echo)$(echo)
|
||||
'6 6 double-quoted-argument-unclosed' # "
|
||||
'7 13 command-substitution-quoted' # $(echo)
|
||||
'7 8 command-substitution-delimiter-quoted' # $(
|
||||
'9 12 builtin' # echo
|
||||
'13 13 command-substitution-delimiter-quoted' # )
|
||||
'14 20 command-substitution-quoted' # $(echo)
|
||||
'14 15 command-substitution-delimiter-quoted' # $(
|
||||
'16 19 builtin' # echo
|
||||
'20 20 command-substitution-delimiter-quoted' # )
|
||||
)
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER=$'foo=$(echo bar) :'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 15 assign' # foo=$(echo bar)
|
||||
'5 15 default' # $(echo bar)
|
||||
'5 15 command-substitution-unquoted' # $(echo bar)
|
||||
'5 6 command-substitution-delimiter-unquoted' # $(
|
||||
'7 10 builtin' # echo
|
||||
'12 14 default' # bar
|
||||
'15 15 command-substitution-delimiter-unquoted' # )
|
||||
'17 17 builtin' # :
|
||||
)
|
||||
@@ -1,45 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER=$': foo$(echo bar'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 builtin' # :
|
||||
'3 15 default' # foo$(echo bar
|
||||
'6 15 command-substitution-unquoted' # $(echo bar
|
||||
'6 7 command-substitution-delimiter-unquoted' # $(
|
||||
'8 11 builtin' # echo
|
||||
'13 15 default' # bar
|
||||
)
|
||||
|
||||
if [[ ${(z):-'$('} == '$( ' ]]; then # ignore zsh 5.0.8 bug
|
||||
expected_region_highlight[2]='3 16 default' # foo$(echo bar
|
||||
expected_region_highlight[3]='6 16 command-substitution-unquoted' # $(echo bar
|
||||
fi
|
||||
@@ -30,7 +30,6 @@
|
||||
BUFFER=':; pwd &! ls'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 1 builtin" # :
|
||||
"2 2 commandseparator" # ;
|
||||
"4 6 builtin" # pwd
|
||||
"8 9 commandseparator" # &!
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2016 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
setopt interactivecomments
|
||||
BUFFER=$'# foo\ntrue'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 5 comment' # # foo
|
||||
'6 6 commandseparator "issue #501"' # \n
|
||||
'7 10 builtin' # true
|
||||
)
|
||||
@@ -32,5 +32,6 @@ setopt interactive_comments
|
||||
BUFFER='# echo foo'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 10 comment" # # echo foo
|
||||
"1 1 comment" # #
|
||||
"2 10 comment" # " echo foo"
|
||||
)
|
||||
|
||||
@@ -33,7 +33,6 @@ BUFFER='echo "foo #bar" #baz # quux'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 4 builtin" # echo
|
||||
"6 15 default" # "foo #bar"
|
||||
"6 15 double-quoted-argument" # "foo #bar"
|
||||
"17 27 comment" # #baz # quux
|
||||
)
|
||||
|
||||
@@ -27,19 +27,10 @@
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
local x=/usr/bin/env
|
||||
local y=sudo
|
||||
local -a z; z=(zsh -f)
|
||||
sudo(){}
|
||||
|
||||
BUFFER='$x "argument"; $y; $z'
|
||||
x=/usr/bin/env
|
||||
BUFFER='$x "argument"'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 2 command" # $x
|
||||
"4 13 default" # "argument"
|
||||
"4 13 double-quoted-argument" # "argument"
|
||||
"14 14 commandseparator" # ;
|
||||
"16 17 precommand" # $y (sudo)
|
||||
"18 18 unknown-token" # ;
|
||||
"20 21 command" # $z - 'zsh' being the command
|
||||
)
|
||||
|
||||
@@ -34,24 +34,17 @@ expected_region_highlight+=(
|
||||
"7 8 reserved-word" # if
|
||||
"10 13 builtin" # echo
|
||||
"15 19 default" # Hello
|
||||
"20 20 commandseparator" # ;
|
||||
"22 25 reserved-word" # then
|
||||
"27 28 command" # ls
|
||||
"30 30 path" # /
|
||||
"31 31 commandseparator" # ;
|
||||
"33 36 reserved-word" # else
|
||||
"38 39 command" # ls
|
||||
"40 40 commandseparator" # ;
|
||||
"42 43 reserved-word" # fi
|
||||
"44 44 commandseparator" # ;
|
||||
"46 47 reserved-word" # do
|
||||
"49 52 command" # stat
|
||||
"54 56 default" # "x"
|
||||
"54 56 double-quoted-argument" # "x"
|
||||
"57 57 commandseparator" # ;
|
||||
"59 62 reserved-word" # done
|
||||
"63 63 commandseparator" # ;
|
||||
"65 70 reserved-word" # repeat
|
||||
"72 73 default" # 10
|
||||
"75 76 command" # ls
|
||||
)
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
# 0000000 0 01111111111222222 222233333 3 333344 4 4 444444555555555 5 6 6666 6 6 6667777777777888 8 8 88888999 9 9999 9 9 00 00 0000001111
|
||||
# 1234567 8 90123456789012345 678901234 5 678901 2 3 456789012345678 9 0 1234 5 6 7890123456789012 3 4 56789012 3 4567 8 9 01 23 4567890123
|
||||
BUFFER=$'echo Ph\\\'ng`echo lui "mg"\\`echo lw\\\'nafh \\\\\\`echo Cthu"lhu\\\\\\` R\\\\\'ly$(echo eh wag\\\\\\`echo h\\\'nag\\\\\\`\'l\' fht)agn`'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 4 builtin' # echo
|
||||
'6 113 default' # Ph\'ng`echo lui "mg"\`echo lw\'nafh \\\`echo Cthu"lhu\\\` R\\'ly$(echo eh wag\\\`echo h\'nag\\\`'l' fht)agn`
|
||||
'12 113 back-quoted-argument' # `echo lui "mg"\`echo lw\'nafh \\\`echo Cthu"lhu\\\` R\\'ly$(echo eh wag\\\`echo h\'nag\\\`'l' fht)agn`
|
||||
'12 12 back-quoted-argument-delimiter' # `
|
||||
'13 16 builtin' # echo
|
||||
'18 20 default' # lui
|
||||
'22 112 default' # "mg"\`echo lw\'nafh \\\`echo Cthu"lhu\\\` R\\'ly$(echo eh wag\\\`echo h\'nag\\\`'l' fht)agn
|
||||
'22 25 double-quoted-argument' # "mg"
|
||||
'26 112 back-quoted-argument-unclosed' # \`echo lw\'nafh \\\`echo Cthu"lhu\\\` R\\'ly$(echo eh wag\\\`echo h\'nag\\\`'l' fht)agn
|
||||
'26 27 back-quoted-argument-delimiter' # \`
|
||||
'28 31 builtin' # echo
|
||||
'33 40 default' # lw\'nafh
|
||||
'42 62 default' # \\\`echo Cthu"lhu\\\`
|
||||
'42 62 back-quoted-argument' # \\\`echo Cthu"lhu\\\`
|
||||
'42 45 back-quoted-argument-delimiter' # \\\`
|
||||
'46 49 builtin' # echo
|
||||
'51 58 default' # Cthu"lhu
|
||||
'55 58 double-quoted-argument-unclosed' # "lhu
|
||||
'59 62 back-quoted-argument-delimiter' # \\\`
|
||||
'64 112 default' # R\\'ly$(echo eh wag\\\`echo h\'nag\\\`'l' fht)agn
|
||||
'70 109 command-substitution-unquoted' # $(echo eh wag\\\`echo h\'nag\\\`'l' fht)
|
||||
'70 71 command-substitution-delimiter-unquoted' # $(
|
||||
'72 75 builtin' # echo
|
||||
'77 78 default' # eh
|
||||
'80 104 default' # wag\\\`echo h\'nag\\\`'l'
|
||||
'83 101 back-quoted-argument' # \\\`echo h\'nag\\\`
|
||||
'83 86 back-quoted-argument-delimiter' # \\\`
|
||||
'87 90 builtin' # echo
|
||||
'92 97 default' # h\'nag
|
||||
'98 101 back-quoted-argument-delimiter' # \\\`
|
||||
'102 104 single-quoted-argument' # 'l'
|
||||
'106 108 default' # fht
|
||||
'109 109 command-substitution-delimiter-unquoted' # )
|
||||
'113 113 unknown-token' # `
|
||||
)
|
||||
@@ -1,40 +0,0 @@
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2018 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
mkdir foo
|
||||
touch foo/bar
|
||||
BUFFER=": foo/bar $PWD/foo foo/b"
|
||||
X_ZSH_HIGHLIGHT_DIRS_BLACKLIST=($PWD/foo $PWD/bar)
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 builtin' # :
|
||||
'3 9 default' # foo/bar
|
||||
"11 $(( 14 + $#PWD )) default" # $PWD/foo
|
||||
"$(( 16 + $#PWD )) $(( 20 + $#PWD )) default" # foo/b
|
||||
)
|
||||
@@ -32,8 +32,8 @@ BUFFER=': "$$ $$foo"'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 builtin' # :
|
||||
'3 12 default' # "$$ $$foo"
|
||||
'3 12 double-quoted-argument' # "$$ $$foo"
|
||||
'3 3 double-quoted-argument' # "
|
||||
'4 5 dollar-double-quoted-argument' # $$
|
||||
'7 8 dollar-double-quoted-argument' # $$
|
||||
'9 12 double-quoted-argument' # foo"
|
||||
)
|
||||
|
||||
@@ -32,11 +32,15 @@ BUFFER=': "$- $# $* $@ $?"'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 builtin' # :
|
||||
'3 18 default' # "$- $# $* $@ $?"
|
||||
'3 18 double-quoted-argument' # "$- $# $* $@ $?"
|
||||
'3 3 double-quoted-argument' # "
|
||||
'4 5 dollar-double-quoted-argument' # $-
|
||||
'6 6 double-quoted-argument' # <space>
|
||||
'7 8 dollar-double-quoted-argument' # $#
|
||||
'9 9 double-quoted-argument' # <space>
|
||||
'10 11 dollar-double-quoted-argument' # $*
|
||||
'12 12 double-quoted-argument' # <space>
|
||||
'13 14 dollar-double-quoted-argument' # $@
|
||||
'15 15 double-quoted-argument' # <space>
|
||||
'16 17 dollar-double-quoted-argument' # $?
|
||||
'18 18 double-quoted-argument' # "
|
||||
)
|
||||
|
||||
@@ -28,22 +28,11 @@
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER=': "$(:)" "foo$(:)bar'
|
||||
BUFFER=': "$(:)"'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 builtin' # :
|
||||
'3 8 default' # "$(:)"
|
||||
'3 3 double-quoted-argument' # "$(:)"
|
||||
'8 8 double-quoted-argument' # "$(:)"
|
||||
'4 7 command-substitution-quoted' # $(:)
|
||||
'4 5 command-substitution-delimiter-quoted' # $(
|
||||
'6 6 builtin' # :
|
||||
'7 7 command-substitution-delimiter-quoted' # )
|
||||
'10 20 default' # "foo$(:)bar
|
||||
'10 13 double-quoted-argument-unclosed' # "foo
|
||||
'18 20 double-quoted-argument-unclosed' # bar
|
||||
'14 17 command-substitution-quoted' # $(:)
|
||||
'14 15 command-substitution-delimiter-quoted' # $(
|
||||
'16 16 builtin' # :
|
||||
'17 17 command-substitution-delimiter-quoted' # )
|
||||
'3 3 double-quoted-argument' # "
|
||||
'4 4 dollar-double-quoted-argument' # $
|
||||
'5 8 double-quoted-argument' # (:)"
|
||||
)
|
||||
|
||||
@@ -30,9 +30,6 @@
|
||||
BUFFER=": \$'*' 'foo'"
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 1 builtin" # :
|
||||
"3 6 default" # $'*'
|
||||
"3 6 dollar-quoted-argument" # $'*' - not a glob
|
||||
"8 12 default" # 'foo'
|
||||
"8 12 single-quoted-argument" # 'foo'
|
||||
)
|
||||
|
||||
@@ -30,10 +30,11 @@
|
||||
BUFFER=": \$'foo\xbar\udeadbeef\uzzzz'"
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 1 builtin" # :
|
||||
"3 29 default" # $'foo\xbar\udeadbeef\uzzzz'
|
||||
"3 29 dollar-quoted-argument" # $'foo\xbar\udeadbeef\uzzzz'
|
||||
"3 7 dollar-quoted-argument" # $'foo
|
||||
"8 11 back-dollar-quoted-argument" # \xba
|
||||
"12 12 dollar-quoted-argument" # r
|
||||
"13 18 back-dollar-quoted-argument" # \dead
|
||||
"19 22 dollar-quoted-argument" # beef
|
||||
"23 24 unknown-token" # \u
|
||||
"25 29 dollar-quoted-argument" # zzzz'
|
||||
)
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
BUFFER=": \$'\xa1"
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 1 builtin" # :
|
||||
"3 8 default" # $'\xa1
|
||||
"3 8 dollar-quoted-argument-unclosed" # $'\xa1
|
||||
"3 4 dollar-quoted-argument" # $'
|
||||
"5 8 back-dollar-quoted-argument" # \xa1
|
||||
)
|
||||
|
||||
@@ -30,6 +30,5 @@
|
||||
BUFFER='hello --world'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 5 unknown-token" # hello
|
||||
"7 13 double-hyphen-option" # --world
|
||||
)
|
||||
|
||||
@@ -31,12 +31,15 @@ BUFFER=': "foo$bar:\`:\":\$:'
|
||||
BUFFER+=\\\\:\"
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 1 builtin" # :
|
||||
"3 24 default" # "foo$bar:\`:\":\$:\\:"
|
||||
"3 24 double-quoted-argument" # "foo$bar:\`:\":\$:\\:"
|
||||
"3 6 double-quoted-argument" # "foo
|
||||
"7 10 dollar-double-quoted-argument" # $bar
|
||||
"11 11 double-quoted-argument" # :
|
||||
"12 13 back-double-quoted-argument" # \`
|
||||
"14 14 double-quoted-argument" # :
|
||||
"15 16 back-double-quoted-argument" # \$
|
||||
"17 17 double-quoted-argument" # :
|
||||
"18 19 back-double-quoted-argument" # \"
|
||||
"20 20 double-quoted-argument" # :
|
||||
"21 22 back-double-quoted-argument" # \\
|
||||
"23 24 double-quoted-argument" # :"
|
||||
)
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
BUFFER=': "foo$bar'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 1 builtin" # :
|
||||
"3 10 default" # "foo$bar
|
||||
"3 10 double-quoted-argument-unclosed" # "foo$bar
|
||||
"3 6 double-quoted-argument" # "foo
|
||||
"7 10 dollar-double-quoted-argument" # $bar
|
||||
)
|
||||
|
||||
@@ -31,12 +31,9 @@ BUFFER=': "$" "$42foo"'
|
||||
BUFFER+=\ \"\\\'\\x\"
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 1 builtin" # :
|
||||
"3 5 default" # "$"
|
||||
"3 5 double-quoted-argument" # "$"
|
||||
"7 14 default" # "$42foo"
|
||||
"7 14 double-quoted-argument" # "$42foo"
|
||||
"7 7 double-quoted-argument" # "
|
||||
"8 10 dollar-double-quoted-argument" # $42
|
||||
"16 21 default" # "\'\x"
|
||||
"11 14 double-quoted-argument" # foo"
|
||||
"16 21 double-quoted-argument" # "\'\x" - \' and \x are not escape sequences
|
||||
)
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
BUFFER=': "${foo}bar"'
|
||||
|
||||
expected_region_highlight=(
|
||||
"1 1 builtin" # :
|
||||
"3 13 default" # "${foo}bar"
|
||||
"3 13 double-quoted-argument" # "${foo}bar"
|
||||
"3 3 double-quoted-argument" # "
|
||||
"4 9 dollar-double-quoted-argument" # ${foo}
|
||||
"10 13 double-quoted-argument" # bar"
|
||||
)
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) 2019 zsh-syntax-highlighting contributors
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
# provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
# and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of
|
||||
# conditions and the following disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
# * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without specific prior
|
||||
# written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
|
||||
BUFFER=$':;\n'
|
||||
|
||||
expected_region_highlight=(
|
||||
'1 1 builtin' # :
|
||||
'2 2 commandseparator' # ;
|
||||
'3 3 issue-623 "issue #616"' # \n
|
||||
)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user