Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Useless assignment in _rm



zsugabubus wrote on Mon, 22 Jun 2020 12:27 +0200:
> diff --git a/Completion/Unix/Command/_rm b/Completion/Unix/Command/_rm
> index ea9190d..e66b77f 100644
> --- a/Completion/Unix/Command/_rm
> +++ b/Completion/Unix/Command/_rm
> @@ -69,7 +69,7 @@ _arguments -C -s -S $opts \
> 
>  case $state in
>    (file)
> -    line[CURRENT]=()
> +    (( CURRENT > 0 )) && line[CURRENT]=()
>      line=( ${line//(#m)[\[\]()\\*?#<>~\^\|]/\\$MATCH} )
>      _files -F line && ret=0
>      ;;

Thanks; I'll commit this unless someone sees a reason not to.

In the future, could you put patches _above_ the dash-dash-space line?
Many MUAs trim by default everything after that line.

Thanks,

Daniel



Messages sorted by: Reverse Date, Date, Thread, Author