From 0dfd528f6e7fe01b5538117edf03aa39c38701c5 Mon Sep 17 00:00:00 2001 From: Adam Katz <6454774+adamhotep@users.noreply.github.com> Date: Thu, 18 Jul 2024 17:52:54 -0400 Subject: [PATCH] Support version 5.10 Just taking the first three characters of $ZSH_VERSION would result in 5.10 becoming 5.1 and then failing this check. I've updated your logic to strip off the second dot and anything that follows it, thus ensuring all of these work: 5.10 5.10.1 5.10.1.2.3 5.100. --- plugins/safe-paste/safe-paste.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/safe-paste/safe-paste.plugin.zsh b/plugins/safe-paste/safe-paste.plugin.zsh index d443ae8a2..4a5b7fdea 100644 --- a/plugins/safe-paste/safe-paste.plugin.zsh +++ b/plugins/safe-paste/safe-paste.plugin.zsh @@ -9,7 +9,7 @@ # https://github.com/zsh-users/zsh/blob/f702e17b14d75aa21bff014168fa9048124db286/Functions/Zle/bracketed-paste-magic#L9-L12 # Load bracketed-paste-magic if zsh version is >= 5.1 -if [[ ${ZSH_VERSION:0:3} -ge 5.1 ]]; then +if [[ ${ZSH_VERSION%.${ZSH_VERSION#*.*.}} -ge 5.1 ]]; then set zle_bracketed_paste # Explicitly restore this zsh default autoload -Uz bracketed-paste-magic zle -N bracketed-paste bracketed-paste-magic