fix: Do not try to escape exclamation marks (#399)

This commit is contained in:
Jan Katins 2022-10-29 18:16:36 +02:00 committed by GitHub
parent be1533552a
commit 0e55b2ea67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1178,11 +1178,16 @@ builtin setopt noaliases
# FUNCTION: @zinit-register-annex. [[[
# Registers the z-annex inside Zinit i.e. an Zinit extension
@zinit-register-annex() {
builtin emulate -LR zsh ${=${options[xtrace]:#off}:+-o xtrace}
# See comment in zinit-register-hook() why nobanghist is needed
builtin setopt nobanghist
local name="$1" type="$2" handler="$3" helphandler="$4" icemods="$5" key="z-annex ${(q)2}"
ZINIT_EXTS[seqno]=$(( ${ZINIT_EXTS[seqno]:-0} + 1 ))
ZINIT_EXTS[$key${${(M)type#hook:}:+ ${ZINIT_EXTS[seqno]}}]="${ZINIT_EXTS[seqno]} z-annex-data: ${(q)name} ${(q)type} ${(q)handler} ${(q)helphandler} ${(q)icemods}"
() {
builtin emulate -LR zsh -o extendedglob ${=${options[xtrace]:#off}:+-o xtrace}
# See comment in zinit-register-hook() why nobanghist is needed
builtin setopt nobanghist
integer index="${type##[%a-zA-Z:_!-]##}"
ZINIT_EXTS[ice-mods]="${ZINIT_EXTS[ice-mods]}${icemods:+|}${(j:|:)${(@)${(@s:|:)icemods}/(#b)(#s)(?)/$index-$match[1]}}"
}