From 4640dec63d46107a984db3479e3080962ecb5d2e Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Mon, 27 Feb 2023 14:13:54 +0100 Subject: [PATCH] zsh:suffix(): Use zshisms to find `--`'s index --- .config/zsh/zshrc.d/40-functions.zsh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.config/zsh/zshrc.d/40-functions.zsh b/.config/zsh/zshrc.d/40-functions.zsh index 88e1d7d..6ca9b88 100644 --- a/.config/zsh/zshrc.d/40-functions.zsh +++ b/.config/zsh/zshrc.d/40-functions.zsh @@ -526,11 +526,7 @@ suffix() { return 1 fi - local i=1 - for arg; do - [[ $arg != "--" ]] || break - : "$((i++))" - done + local i=${@[(ei)--]} # NOTE: if "--" is not included in $@, i will be greater than $#, and no # starting point is passed to `find`, which then defaults to `.`.