test failure would not be reflected by the exit code of 'make'.
Setting a shell parameter in the left-hand side of a pipe is not visible to
commands after the pipe, because the left-hand side forks. (That's true both
in 'sh' used by 'make' and in 'zsh' that runs tests/test-highlighting.zsh, at
least on my system.) Therefore, move the colorizing hook to where it doesn't
interfere with setting the $something_failed (in tests/test-highlighting.zsh)
and $result (in Makefile) parameters.
Make the test pass by setting explicitly the global state (existing $HOME) it
depends on. Test another value of the global state (a non-existing $HOME).
That allows tests to be completely independent of each other, so tests that
change global state — such as modify environment variables, define functions or
aliases, or hash commands — will not affect other tests, without needing an
explicit cleanup step.
This enables testing path-tilde-home with and without $HOME set, which is part
of issue #216.
While at it, convert the test harness to TAP. This fixes issue #180 by adding
support for "not ok 42 # TODO" output.
This commit assumes that 'grep' supports POSIX-compliant -q and -v flags.
Patch-by: Matthew Martin <phy1729@gmail.com>
All these files should be sourced, not executed; and Debian's lintian complains:
W: zsh-syntax-highlighting: script-not-executable usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
This reverts commit 8e7c26f489.
Currently, after a 'yank', paste highlighting (via $YANK_ACTIVE in zsh 5.1.1)
is applied but other highlighting (e.g., string highlighting when the yanked
text is «"foo» as a new word) is not.
See issue #183 for context.
Conflicts:
zsh-syntax-highlighting.zsh
As explained in #143 (which was a PR for #99), 'yank-pop' only works when the
previous widget has the ZLE_YANK flag, which means wrapping the 'yank' widget
breaks the 'yank-pop' widget (makes it a no-op). However, that is a reason
against wrapping the 'yank' widget, but not against wrapping the 'yank-pop'
widget. Indeed, if 'yank-pop' is wrapped but 'yank' isn't, then yank-pop
functions correctly and updates highlighting properly.
To unbreak yank-pop, either 'yank' should be excluded from wrapping, or one of
the fixes mentioned on issue #183 should be applied.
Sourcing zsh-syntax-highlighting.zsh without FUNCTION_ARGZERO doesn't work (for
reasons unrelated to this branch), but now errors out gracefully. The failure mode
before this branch was:
zsh-syntax-highlighting: highlighters directory '/usr/local/bin/highlighters' not found.
where /usr/local/bin is dirname() of the zsh binary.