From 12a4bb6000a5d11a4a5dc220f16c4c6ee31333b4 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Wed, 8 Jan 2020 16:45:54 -0500 Subject: [PATCH] Zsh 5.2 does not recognize the :P modifier It fails with _zimfw_build_init:8: unrecognized modifier `P' The `:P` modifier was introduced in Zsh 5.3. Replace it by `:A`, as we still want to keep compatibility with Zsh 5.2. Fixes #349 --- CHANGELOG.md | 3 ++- src/stage2/29_zimfw_build_init.zsh.erb | 4 ++-- src/zimfw.zsh.erb | 2 +- zimfw.zsh | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3932785..01db984 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -_No unreleased changes_ +### Fixed +- Zsh 5.2 does not recognize the `:P` modifier. Replace it by `:A`. ## [1.0.0] - 2020-01-07 diff --git a/src/stage2/29_zimfw_build_init.zsh.erb b/src/stage2/29_zimfw_build_init.zsh.erb index 0eb0994..f4e3c1c 100644 --- a/src/stage2/29_zimfw_build_init.zsh.erb +++ b/src/stage2/29_zimfw_build_init.zsh.erb @@ -6,8 +6,8 @@ _zimfw_build_init() { fi _zimfw_mv =( print -R "zimfw() { source ${ZIM_HOME}/zimfw.zsh \"\${@}\" }" - (( ${#_zfpaths} )) && print -R 'fpath=('${_zfpaths:P}' ${fpath})' + (( ${#_zfpaths} )) && print -R 'fpath=('${_zfpaths:A}' ${fpath})' (( ${#_zfunctions} )) && print -R 'autoload -Uz '${_zfunctions} - print -Rn ${(F):-source ${^_zscripts:P}} + print -Rn ${(F):-source ${^_zscripts:A}} ) ${ztarget} } diff --git a/src/zimfw.zsh.erb b/src/zimfw.zsh.erb index 780c3a9..ad36665 100644 --- a/src/zimfw.zsh.erb +++ b/src/zimfw.zsh.erb @@ -6,7 +6,7 @@ class Zim @home = "${ZDOTDIR:-${HOME}}" @min_zsh_version = "5.2" @startup_files_glob = ".z(shenv|shrc|login|logout)" - @version = "1.0.0" + @version = "1.0.1-SNAPSHOT" @ellipsis = " ..." @okay = "%F{green})%f " @error = "x " diff --git a/zimfw.zsh b/zimfw.zsh index 75176c6..8a6bdcc 100644 --- a/zimfw.zsh +++ b/zimfw.zsh @@ -56,9 +56,9 @@ _zimfw_build_init() { fi _zimfw_mv =( print -R "zimfw() { source ${ZIM_HOME}/zimfw.zsh \"\${@}\" }" - (( ${#_zfpaths} )) && print -R 'fpath=('${_zfpaths:P}' ${fpath})' + (( ${#_zfpaths} )) && print -R 'fpath=('${_zfpaths:A}' ${fpath})' (( ${#_zfunctions} )) && print -R 'autoload -Uz '${_zfunctions} - print -Rn ${(F):-source ${^_zscripts:P}} + print -Rn ${(F):-source ${^_zscripts:A}} ) ${ztarget} } @@ -263,7 +263,7 @@ _zimfw_compile() { } _zimfw_info() { - print 'Zim version: 1.0.0 (previous commit is edee218)' + print 'Zim version: 1.0.1-SNAPSHOT (previous commit is 0213f77)' print -R 'ZIM_HOME: '${ZIM_HOME} print -R 'Zsh version: '${ZSH_VERSION} print -R 'System info: '$(command uname -a)