mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2024-09-19 05:41:15 +02:00
versioning: Add versioning information: .version, .revision-hash, $ZSH_HIGHLIGHT_VERSION.
* danielsh/versionstamp: versionstamp: Set up '.revision-hash' file. versionstamp: Handle NO_FUNCTION_ARGZERO. Set the version number.
This commit is contained in:
commit
9a3c7d1960
4 changed files with 14 additions and 0 deletions
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
.revision-hash export-subst
|
1
.revision-hash
Normal file
1
.revision-hash
Normal file
|
@ -0,0 +1 @@
|
||||||
|
$Format:%H$
|
1
.version
Normal file
1
.version
Normal file
|
@ -0,0 +1 @@
|
||||||
|
0.3.0-dev
|
|
@ -29,6 +29,17 @@
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
if [[ -o function_argzero ]]; then
|
||||||
|
# $0 is reliable
|
||||||
|
ZSH_HIGHLIGHT_VERSION=$(<"$0:h"/.version)
|
||||||
|
else
|
||||||
|
# $0 is unreliable, so the call to _zsh_highlight_load_highlighters will fail.
|
||||||
|
# TODO: If 'zmodload zsh/parameter' is available, ${funcsourcetrace[1]%:*} might serve as a substitute?
|
||||||
|
# TODO: also check POSIX_ARGZERO, but not it's not available in older zsh
|
||||||
|
echo "zsh-syntax-highlighting: error: not compatible with FUNCTION_ARGZERO" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
# Core highlighting update system
|
# Core highlighting update system
|
||||||
# -------------------------------------------------------------------------------------------------
|
# -------------------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue