Skip to content

Commit

Permalink
>file alias expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
MenkeTechnologies committed Apr 24, 2022
1 parent e16f6ee commit ed90d41
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions zpwrExpandApi.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,21 @@ function zpwrExpandParseWords(){
# we must find the first index of the partition
firstIndex=0

for (( i = $#mywordsleft; i >= 0; i-- )); do
for (( i = $#mywordsleft; i >= 1; i-- )); do
# ;; ; | || && are statement separating chars
# we will split the command line and get the statement of the cursor
# regular aliases are valid in the first position of this statement
case $mywordsleft[$i] in
';;' | \; | \| | '||' | '&&' | '(' | '{')
firstIndex=$((i+1))
firstIndex=$((i + 1))
break
;;
'>'* | '<'* | '&>'*)
#remove redirection operator from left words
mywordsleft[$i]=()
#remove redirected file
mywordsleft[$i]=()
;;
*)
;;
esac
Expand Down

0 comments on commit ed90d41

Please sign in to comment.