* origin/master: (297 commits) driver: Follow-up to grandparent: Have all test suite entry points declare the mock $region_highlight. Use the new, unreleased zsh 'memo=' feature to remove only our own entries from $region_highlight. driver: Stop re-declaring $region_highlight. It's unneeded. docs: regexp highlighter: Fix a wrong associative array name in the example. docs: Fix obs-repository link tests: Fix a wrong value of $PREBUFFER in a test, and add checks to prevent this from recurring. test harness: Fix use of an undefined variable in an error message. 'main': Don't progress the $in_redirection staller while $in_param. tests: Add an XFail test for issue #712. 'main': Highlight the parentheses of array assignments as reserved words. CI += zsh-5.8 main: Add tests for arithmetic expansion main: Add arithmetic substitution highlighting changelog.md: Restore vertical whitespace before section headers. 'main': Fix issue #677, concerning multiline aliases. changelog: Update through HEAD. 'main': Further optimize argument parsing. 'main': Optimize a hot path. tests: Add a performance testing script, for measuring the performance of the 'main' highlighter on a large file. changelog: Update through HEAD. test harness: Print the expected-v.-actual on every failure, not just upon cardinality failures. Document ZSH_HIGHLIGHT_MAXLENGTH. 'main': Fix the last commit's bug concerning parameter elision not happening in redirects in command position. 'main': Add a test for parameter elision not happening in redirects in command position. 'main': Fix regression in zsh 5.3.1 and older: all precmd hooks later than z-sy-h would be aborted. changelog += WARN_NESTED_VAR fixes (#727, #731) 'main': Fix a regression caused by the great-grandparent commit's WARN_NESTED_VAR fix. 'main': Don't run `_zsh_highlight_main__type` on every non-command word. 'make perf': Show only a cumulative datum per highligher, rather than per test file. 'main': Don't trip WARN_NESTED_VAR. 'main': Follow-up to previous: Document the version number, and deduplicate some option letters. 'main': precommands += strace editorconfig: Fix Makefile settings Fix typo Bump copyright years. driver: Fix "_zsh_highlight:3: read-only variable: ret" warnings when POSIX_BUILTINS is set. tests: Add a test for the infinite loop fixed by each of the last two commits. 'main': Fix expansion of positional parameters in `_zsh_highlight_main_highlighter__try_expand_parameter`. 'main': Fix an infinite loop. 'main': precommands += ionice(1) (from util-linux) driver: Simplify initialization of $zsyh_user_options in the fallback codepath. driver: Make sure we don't change the return value in a called function. 'main': Make logic more robust. No functional change. 'main': Break out an anonymous function into a named function. Fix typos in comments. main: Add test for issue #713 'main': Support the 'env' precommand. test harness: Fix the pretty-printer's padding implementation. Revert "test harness: Rewrite the columnar pretty-printer without external tools." and "travis: Remove bsdmainutils since column(1) has been removed, three commits ago." changelog: Update through HEAD. 'main': Correctly highlight '&&' and '||' inside '[[ … ]]' conditions. 'main': Highlight reserved words following assignments as errors. tests: Add tests for issue #461. test harness: Output the time information to the same place the test name was printed to. test harness: Stringify values in a more readable manner. tests: Add a unit test for a path specified with mixed quoting. tests: Add a test for issue #498, which has already been fixed. tests: Test that global qualifiers and command substitutions aren't evaluated. 'main': Don't consider path_prefix in alias expansions. 'main': Add a test for aliases to AUTO_CD directories. 'main': Let AUTO_CD directories be highlighted with their own style. 'main': Add an auxiliary variable for readability. 'main': In command position, do not highlight directories (unless AUTO_CD is set) and non-executable files. 'main': Extend tests to capture the current behaviour. 'main': Add an XFail test for issue #202. 'main': Highlight errors from the EQUALS option. 'main': Let the type determination ignore global aliases when it ignores regular ones. 'main': Add a regression test for parameters that expand to global aliases. 'main': Enable the zsh/parameter codepath of global aliases highlighting. changelog: Update through HEAD. travis: Remove bsdmainutils since column(1) has been removed, three commits ago. 'main': Highlight global aliases tests: Record current behaviour on global aliases. test harness: Rewrite the columnar pretty-printer without external tools. test harness: Fix an issue with the pretty-printed $expected_region_highlight/$region_highlight diffing. 'main': Support the "close file descriptor" and "coproc" redirection syntaxes tests: Add a test for the "close file descriptor" and "coproc" redirection syntaxes tests: Fix the test added in the last commit. tests: Add a test for issue #705, concerning continuation lines. test harness: Let tests fail early by exiting non-zero or by setting a flag. test harness: Print the test name when $skip_test is set. test harness: Remove a bogus check. test harness: Fix $skip_test support, broken yesterday. travis: Install bsdmainutils to provide column(1). test harness: When the cardinality check fails, pretty-print \$expected_region_highlight and \$region_highlight. test harness: Don't leak options from test files to the test harness. test harness: Fix test failures under zsh 5.0.8 and older. 'main': Fix a bug manifesting under zsh 5.2 and older. 'main': Don't highlight arithmetic expansions as command substitutions. tests: Add a test documenting the current state, prior to introducing #704. test harness: Change cardinality check semantics test harness: No-op change to minimize the next diff. 'main': Document additional meanings of the 'S' $braces_stack flag. 'main': When the redirection operator '>&' or '<&' is followed by a positive integer, do not consider that as a filename; it's always a file descriptor. 'main': Add $last_arg for "lookbehind". noop: Clarify comment. 'main': Honour the MULTIOS option when applying the 'globbing' style. 'main': Document what $in_redirection is currently used for. 'main': The optimized cmdsubst input syntax doesn't glob. changelog: Fix markup. ...pull/749/head
@ -0,0 +1,15 @@ | |||
# Top-most editorconfig file | |||
root = true | |||
[*] | |||
end_of_line = lf | |||
tab_width = 2 | |||
indent_size = 2 | |||
indent_style = space | |||
[Makefile] | |||
tab_width = 8 | |||
indent_size = 8 | |||
indent_style = tab | |||
@ -1 +1 @@ | |||
0.7.0-dev | |||
0.7.2-dev |
@ -0,0 +1,35 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$'/' | |||
expected_region_highlight=( | |||
'1 1 path_prefix' # / | |||
) |
@ -0,0 +1,36 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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 autocd | |||
BUFFER=$'/' | |||
expected_region_highlight=( | |||
'1 1 autodirectory' # / | |||
) |
@ -0,0 +1,35 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$'/bi' | |||
expected_region_highlight=( | |||
'1 3 path_prefix' # /bi | |||
) |
@ -0,0 +1,37 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$'/bin; /bin' | |||
expected_region_highlight=( | |||
'1 4 unknown-token' # /bin (in middle) | |||
'5 5 commandseparator' # ; | |||
'7 10 path_prefix' # /bin (at end) | |||
) |
@ -0,0 +1,38 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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 autocd | |||
BUFFER=$'/bin; /bin' | |||
expected_region_highlight=( | |||
'1 4 autodirectory' # /bin (in middle) | |||
'5 5 commandseparator' # ; | |||
'7 10 autodirectory' # /bin (at end) | |||
) |
@ -0,0 +1,35 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$'/bin/s' | |||
expected_region_highlight=( | |||
'1 6 path_prefix' # /bin/s | |||
) |
@ -0,0 +1,35 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$'/bin/sh' | |||
expected_region_highlight=( | |||
'1 7 command' # /bin/sh | |||
) |
@ -0,0 +1,35 @@ | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2015 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 foo="echo hello world" | |||
BUFFER="foo" | |||
expected_region_highlight+=( | |||
"1 3 alias" # foo | |||
) |
@ -0,0 +1,37 @@ | |||
# ------------------------------------------------------------------------------------------------- | |||
# 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 must be at least 4 characters to test the regression | |||
# cf. 139ea2b189819c43cc251825981c116959b15cc3 | |||
alias foobar='echo "$(echo foobar)"' | |||
BUFFER='foobar' | |||
expected_region_highlight=( | |||
"1 6 alias" # foobar | |||
) |
@ -0,0 +1,38 @@ | |||
# ------------------------------------------------------------------------------------------------- | |||
# 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 | |||
) |
@ -0,0 +1,38 @@ | |||
# ------------------------------------------------------------------------------------------------- | |||
# 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 | |||
) |
@ -0,0 +1,36 @@ | |||
# ------------------------------------------------------------------------------------------------- | |||
# 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 ls='command ls' | |||
BUFFER='ls' | |||
expected_region_highlight=( | |||
"1 2 alias" # ls | |||
) |
@ -0,0 +1,36 @@ | |||
# ------------------------------------------------------------------------------------------------- | |||
# 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 ls=tmp tmp='command ls' | |||
BUFFER='ls' | |||
expected_region_highlight=( | |||
"1 2 alias" # ls | |||
) |
@ -0,0 +1,43 @@ | |||
#!/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 p='print -r --' | |||
BUFFER=$'s=$(p foo)' | |||
expected_region_highlight=( | |||
'1 10 assign' # s=$(p foo) | |||
'3 10 default' # $(p foo) | |||
'3 10 command-substitution-unquoted' # $(p foo) | |||
'3 4 command-substitution-delimiter-unquoted' # $( | |||
'5 5 alias' # p | |||
'7 9 default' # foo | |||
'10 10 command-substitution-delimiter-unquoted' # ) | |||
) |
@ -0,0 +1,35 @@ | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2015 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 ls="ls" | |||
BUFFER="ls" | |||
expected_region_highlight+=( | |||
"1 2 alias" # ls | |||
) |
@ -0,0 +1,38 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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 '$foo'='echo alias' | |||
local foo; foo=(echo param) | |||
BUFFER='$foo' | |||
expected_region_highlight=( | |||
'1 4 alias' # $foo | |||
) |
@ -0,0 +1,42 @@ | |||
#!/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 | |||
# ------------------------------------------------------------------------------------------------- | |||
# See also param-precommand-option-argument1.zsh | |||
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 | |||
) |
@ -0,0 +1,42 @@ | |||
#!/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 | |||
) |
@ -0,0 +1,42 @@ | |||
#!/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 | |||
# ------------------------------------------------------------------------------------------------- | |||
# See also param-precommand-option-argument3.zsh | |||
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 | |||
) |
@ -0,0 +1,36 @@ | |||
#!/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' # x (/) | |||
) |
@ -0,0 +1,37 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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 autocd | |||
alias x=/ | |||
BUFFER=$'x' | |||
expected_region_highlight=( | |||
'1 1 alias' # x | |||
) |
@ -0,0 +1,37 @@ | |||
#!/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 | |||
) |
@ -0,0 +1,37 @@ | |||
#!/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 | |||
) |
@ -0,0 +1,46 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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 builtin' # : | |||
'3 15 default' # $((ls); (ls)) | |||
'3 15 command-substitution-unquoted' # $((ls); (ls)) | |||
'3 4 command-substitution-delimiter-unquoted' # $( | |||
'5 5 reserved-word' # ( | |||
'6 7 command' # ls | |||
'8 8 reserved-word' # ) | |||
'9 9 commandseparator' # ; | |||
'11 11 reserved-word' # ( | |||
'12 13 command' # ls | |||
'14 14 reserved-word' # ) | |||
'15 15 command-substitution-delimiter-unquoted' # ) | |||
) |
@ -0,0 +1,37 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$': $(( 6 * 9 ))' | |||
expected_region_highlight=( | |||
'1 1 builtin' # : | |||
'3 14 default' # $(( 6 * 9 )) | |||
'3 14 arithmetic-expansion' # $(( 6 * 9 )) | |||
) |
@ -0,0 +1,38 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$': "$(( 6 * 9 ))"' | |||
expected_region_highlight=( | |||
'1 1 builtin' # : | |||
'3 16 default' # "$(( 6 * 9 ))" | |||
'3 16 double-quoted-argument' # "$(( 6 * 9 ))" | |||
'4 15 arithmetic-expansion' # $(( 6 * 9 )) | |||
) |
@ -0,0 +1,42 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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 2) + 2 ))' | |||
expected_region_highlight=( | |||
'1 1 builtin' # : | |||
'3 22 default' # $(( $(echo 2) + 2 )) | |||
'3 22 arithmetic-expansion' # $(( $(echo 2) + 2 )) | |||
'7 15 command-substitution-quoted' # $(echo 2) | |||
'7 8 command-substitution-delimiter-quoted' # $( | |||
'9 12 builtin' # echo | |||
'14 14 default' # 2 | |||
'15 15 command-substitution-delimiter' # ) | |||
) |
@ -0,0 +1,37 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$': $(( ((42)) ))' | |||
expected_region_highlight=( | |||
'1 1 builtin' # : | |||
'3 15 default' # $(( ((42)) )) | |||
'3 15 arithmetic-expansion' # $(( ((42)) )) | |||
) |
@ -0,0 +1,39 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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"' | |||
expected_region_highlight=( | |||
'1 1 builtin' # : | |||
'3 17 default' # "foo"$(())"bar" | |||
'3 7 double-quoted-argument' # "foo" | |||
'8 12 arithmetic-expansion' # $(()) | |||
'13 17 double-quoted-argument' # "bar" | |||
) |
@ -0,0 +1,38 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$': $(( \!\! ))' | |||
expected_region_highlight=( | |||
'1 1 builtin' # : | |||
'3 11 default' # $(( !! )) | |||
'3 11 arithmetic-expansion' # $(( !! )) | |||
'7 8 history-expansion "issue #713"' # !! | |||
) |
@ -0,0 +1,39 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$': $(( 0 * 1\'\'000 ))' | |||
expected_region_highlight=( | |||
'1 1 builtin' # : | |||
'3 19 default' # $(( 0 * 1\'\'000 )) | |||
'3 19 arithmetic-expansion' # $(( 0 * 1\'\'000 )) | |||
'12 12 unknown-token' # \' | |||
'13 13 unknown-token' # \' | |||
) |
@ -0,0 +1,39 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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*$(( 42 * 1729 ))*bar' | |||
expected_region_highlight=( | |||
'1 1 builtin' # : | |||
'3 26 default' # foo*$(( 42 * 1729 ))*bar | |||
'6 6 globbing' # * | |||
'7 22 arithmetic-expansion' # $(( 42 * 1729 )) | |||
'23 23 globbing' # * | |||
) |
@ -0,0 +1,38 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$': $(( $(( 1 + 2 )) * 3 ))' | |||
expected_region_highlight=( | |||
'1 1 builtin' # : | |||
'3 25 default' # $(( $(( 1 + 2 )) * 3 )) | |||
'3 25 arithmetic-expansion' # $(( $(( 1 + 2 )) * 3 )) | |||
'7 18 arithmetic-expansion' # $(( 1 + 2 )) | |||
) |
@ -0,0 +1,38 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$': "$(( 1 + 1 ))"' | |||
expected_region_highlight=( | |||
'1 1 builtin' # : | |||
'3 16 default' # "$(( 1 + 1 ))" | |||
'3 16 double-quoted-argument' # "$(( 1 + 1 ))" | |||
'4 15 arithmetic-expansion' # $(( 1 + 1 )) | |||
) |
@ -0,0 +1,37 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$': $(( 1' | |||
expected_region_highlight=( | |||
'1 1 builtin' # : | |||
'3 7 default' # $(( 1 | |||
'3 7 arithmetic-expansion' # $(( 1 | |||
) |
@ -0,0 +1,41 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$': $(( 1729 )' | |||
expected_region_highlight=( | |||
'1 1 builtin' # : | |||
'3 12 default' # $(( 1729 ) | |||
'3 12 arithmetic-expansion' # $(( 1729 ) | |||
) | |||
if [[ ${(z):-'$('} == '$( ' ]]; then # ignore zsh 5.0.8 bug | |||
expected_region_highlight[2]='3 13 default' # $(( 1729 ) | |||
fi |
@ -0,0 +1,45 @@ | |||
#!/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=$'a=( foo | bar )' | |||
bar(){} | |||
expected_region_highlight=( | |||
'1 3 assign' # a=( | |||
'3 3 reserved-word' # ( | |||
'5 7 default' # foo | |||
'9 9 unknown-token' # | | |||
# zsh reports a parse error at this point. Nevertheless, we test how we | |||
# highlight the remainder of $BUFFER. Currently we recover by treating the pipe | |||
# as a command separator. That's not the only reasonable behaviour, though; if | |||
# we change the behaviour, we should adjust the following expectations accordingly. | |||
'11 13 function' # bar | |||
'15 15 unknown-token' # ) | |||
) |
@ -0,0 +1,41 @@ | |||
#!/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=$'a=( foo ; bar )' | |||
expected_region_highlight=( | |||
'1 3 assign' # a=( | |||
'3 3 reserved-word' # ( | |||
'5 7 default' # foo | |||
'9 9 unknown-token' # ; (not commandseparator; see highlighter source code) | |||
'11 13 default' # bar | |||
'15 15 assign' # ) | |||
'15 15 reserved-word' # ) | |||
) |
@ -0,0 +1,41 @@ | |||
#!/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=$'a=( foo \n bar )' | |||
expected_region_highlight=( | |||
'1 3 assign' # a=( | |||
'3 3 reserved-word' # ( | |||
'5 7 default' # foo | |||
'9 9 commandseparator' # \n | |||
'11 13 default' # bar | |||
'15 15 assign' # ) | |||
'15 15 reserved-word' # ) | |||
) |
@ -0,0 +1,37 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=y nosuchcommand' | |||
expected_region_highlight=( | |||
'1 3 assign' # x=y | |||
'3 3 default' # y | |||
'5 17 unknown-token' # nosuchcommand | |||
) |
@ -0,0 +1,45 @@ | |||
#!/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=$'x="$(ls x y z)"' | |||
expected_region_highlight=( | |||
'1 15 assign' # x="$(ls x y z)" | |||
'3 15 default' # "$(ls x y z)" | |||
'3 3 double-quoted-argument' # " | |||
'15 15 double-quoted-argument' # " | |||
'4 14 command-substitution-quoted' # $(ls x y z) | |||
'4 5 command-substitution-delimiter-quoted' # $( | |||
'6 7 command' # ls | |||
'9 9 default' # x | |||
'11 11 default' # y | |||
'13 13 default' # z | |||
'14 14 command-substitution-delimiter-quoted' # ) | |||
) |
@ -0,0 +1,37 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$'s="foo\'bar"' | |||
expected_region_highlight=( | |||
'1 11 assign' # s="foo'bar" | |||
'3 11 default' # "foo'bar" | |||
'3 11 double-quoted-argument' # "foo'bar" | |||
) |
@ -0,0 +1,37 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$'s="foo \'\' bar"' | |||
expected_region_highlight=( | |||
'1 14 assign' # s="foo '' bar" | |||
'3 14 default' # "foo '' bar" | |||
'3 14 double-quoted-argument' # "foo '' bar" | |||
) |
@ -0,0 +1,40 @@ | |||
#!/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=$'foo=bar { :; }' | |||
expected_region_highlight=( | |||
'1 7 assign' # foo=bar | |||
'5 7 default' # bar | |||
'9 9 unknown-token' # { | |||
'11 11 builtin' # : | |||
'12 12 commandseparator' # ; | |||
'14 14 reserved-word' # } | |||
) |
@ -0,0 +1,40 @@ | |||
#!/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=$'foo=bar ( :; )' | |||
expected_region_highlight=( | |||
'1 7 assign' # foo=bar | |||
'5 7 default' # bar | |||
'9 9 unknown-token' # ( | |||
'11 11 builtin' # : | |||
'12 12 commandseparator' # ; | |||
'14 14 unknown-token' # ) | |||
) |
@ -0,0 +1,37 @@ | |||
#!/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=$'foo=bar (( foo ))' | |||
expected_region_highlight=( | |||
'1 7 assign' # foo=bar | |||
'5 7 default' # bar | |||
'9 17 unknown-token' # (( foo )) | |||
) |
@ -0,0 +1,40 @@ | |||
#!/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=$'foo=bar [[ -n foo ]]' | |||
expected_region_highlight=( | |||
'1 7 assign' # foo=bar | |||
'5 7 default' # bar | |||
'9 10 unknown-token' # [[ | |||
'12 13 single-hyphen-option' # -n | |||
'15 17 default' # foo | |||
'19 20 reserved-word' # ]] | |||
) |
@ -0,0 +1,38 @@ | |||
#!/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=$'foo=bar \! :' | |||
expected_region_highlight=( | |||
'1 7 assign' # foo=bar | |||
'5 7 default' # bar | |||
'9 9 unknown-token' # \! | |||
'11 11 builtin' # : | |||
) |
@ -0,0 +1,37 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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=$'1="foo"' | |||
expected_region_highlight=( | |||
'1 7 assign' # 1="foo" | |||
'3 7 default' # "foo" | |||
'3 7 double-quoted-argument' # "foo" | |||
) |
@ -0,0 +1,37 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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\\\nbar"baz"' | |||
expected_region_highlight=( | |||
'1 4 builtin' # echo | |||
'6 18 default "issue #705"' # foo\\\nbar"baz" | |||
'14 18 double-quoted-argument "issue #705"' # "baz" | |||
) |
@ -0,0 +1,34 @@ | |||
# ------------------------------------------------------------------------------------------------- | |||
# 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=$'\\' | |||
expected_region_highlight=( | |||
'1 1 unknown-token' # \\ | |||
) |
@ -0,0 +1,42 @@ | |||
#!/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=( | |||
'5 5 reserved-word' # ( | |||
'6 8 default' # bar | |||
'10 13 default' # abaz | |||
'14 14 assign' # ) | |||
'14 14 reserved-word' # ) | |||
'16 16 unknown-token' # \! | |||
'18 19 command' # ls | |||
) |
@ -0,0 +1,38 @@ | |||
#!/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 | |||
) |
@ -0,0 +1,39 @@ | |||
#!/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 | |||
) |
@ -0,0 +1,38 @@ | |||
#!/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' # ]] | |||
) |
@ -0,0 +1,38 @@ | |||
#!/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' # ] | |||
) |
@ -0,0 +1,40 @@ | |||
#!/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' # ]] | |||
) |
@ -0,0 +1,38 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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 | |||
# ------------------------------------------------------------------------------------------------- | |||
cdpath=( $PWD ) | |||
mkdir foo foo/bar | |||
BUFFER="/foo" | |||
expected_region_highlight=( | |||
'1 4 unknown-token' # x (/) | |||
) |
@ -0,0 +1,44 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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 | |||
# ------------------------------------------------------------------------------------------------- | |||
# Test elision of some, but not all of the words | |||
# See issue #667 for the case of eliding all words | |||
local -a x; x=(sudo "") | |||
sudo(){} | |||
BUFFER=$'$x -u phy1729 ls' | |||
expected_region_highlight=( | |||
'1 2 precommand' # $x | |||
# The "" is elided. If it weren't elided, the «ls» would be highlighted as an ordinary argument. | |||
'4 5 single-hyphen-option' # -u | |||
'7 13 default' # phy1729 | |||
'15 16 command' # ls | |||
) |
@ -0,0 +1,45 @@ | |||
#!/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' # ) | |||
) |
@ -0,0 +1,41 @@ | |||
#!/usr/bin/env zsh | |||
# ------------------------------------------------------------------------------------------------- | |||
# Copyright (c) 2020 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 || baz ]]' | |||
expected_region_highlight=( | |||
'1 2 reserved-word' # [[ | |||
'4 6 default' # foo | |||
'8 9 default' # && | |||
'11 13 default' # bar | |||
'15 16 default' # || | |||
'18 20 default' # baz | |||
'22 23 reserved-word' # ]] | |||
) |
@ -0,0 +1,39 @@ | |||
#!/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 | |||
# ------------------------------------------------------------------------------------------------- | |||
# Newline after semicolon isn't unknown-token | |||
BUFFER=$':;\n:' | |||
expected_region_highlight=( | |||
'1 1 builtin' # : | |||
'2 2 commandseparator' # ; | |||
'3 3 commandseparator' # \n | |||
'4 4 builtin' # : | |||
) |
@ -0,0 +1,36 @@ | |||
#!/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; ls' | |||
expected_region_highlight=( | |||
'3 3 unknown-token' # ; | |||
'5 6 command' # ls | |||
) |