From b02ecee9eeafd5d0218b6dd82b7f59ef93ee6c76 Mon Sep 17 00:00:00 2001 From: MenkeTechnologies Date: Mon, 30 May 2022 08:07:13 -0400 Subject: [PATCH] handle nocorrect and noglob properly --- zsh-expand.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zsh-expand.plugin.zsh b/zsh-expand.plugin.zsh index e783aa1..650ef05 100644 --- a/zsh-expand.plugin.zsh +++ b/zsh-expand.plugin.zsh @@ -48,7 +48,7 @@ fi #{{{ MARK:regex #************************************************************** -ZPWR_VARS[builtinSkips]='(command|time|exec|eval|nocorrect|noglob)' +ZPWR_VARS[builtinSkips]='(command|exec|eval|nocorrect|noglob|-)' ZPWR_VARS[blacklistUser]="" if (( $#ZPWR_EXPAND_BLACKLIST )); then @@ -68,7 +68,7 @@ fi ZPWR_VARS[blacklistSubcommandPositionRegex]='^(cargo|jenv|svn|git|ng|pod|docker|kubectl|rndc|yarn|npm|pip[0-9\.]*|bundle|rails|gem|nmcli|brew|apt|dnf|yum|zypper|pacman|service|proxychains[0-9\.]*|zpwr|zm|zd|zg|zinit)$' # the main regex to match x=1 \builtin* 'command'* '"sudo"' -* y=2 \env* -* z=3 cmd arg1 arg2 etc - ZPWR_VARS[continueFirstPositionRegexNoZpwr]="^([$ws]*)((${sq}builtin${eq}[$ws]+)*${sq}${ZPWR_VARS[builtinSkips]}${eq})?([$ws]*)((${sq}[sS][uU][dD][oO]${eq}([$ws]+)(${sq}(-[ABbEHnPSis]+${eq}[$ws]*|-[CghpTu][$ws=]+[$l]*${eq}[$ws]+|--${eq})*)*)*(${sq}[eE][nN][vV]${eq}[$ws]+(${sq}-[iv]+${eq}[$ws]*|-[PSu][$ws=]+[$l]*${eq}[$ws]+|--${eq})*)*(${sq}[nN][iI][cC][eE]${eq}[$ws]+)*(${sq}[tT][iI][mM][eE]${eq}[$ws]+)*)*([$ws]*)(.*)$" + ZPWR_VARS[continueFirstPositionRegexNoZpwr]="^([$ws]*)((${sq}(nocorrect|time)${eq}[$ws]+)*(${sq}builtin${eq}[$ws]+)*(${sq}${ZPWR_VARS[builtinSkips]}${eq}[$ws]+)*)?((${sq}[sS][uU][dD][oO]${eq}([$ws]+)(${sq}(-[ABbEHnPSis]+${eq}[$ws]*|-[CghpTu][$ws=]+[$l]*${eq}[$ws]+|--${eq})*)*)*(${sq}[eE][nN][vV]${eq}[$ws]+(${sq}-[iv]+${eq}[$ws]*|-[PSu][$ws=]+[$l]*${eq}[$ws]+|--${eq})*)*(${sq}[nN][iI][cC][eE]${eq}[$ws]+)*(${sq}[tT][iI][mM][eE]${eq}[$ws]+)*)*([$ws]*)(.*)$" }