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

Re: [PATCH] Increase $COLUMNS when generating long option completions



On Tue, Aug 10, 2021 at 10:04 PM Marlon Richert
<marlon.richert@xxxxxxxxx> wrote:
>
> On Sun, Aug 8, 2021 at 1:41 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> >
> > On Sat, Aug 7, 2021 at 12:56 PM Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
> > >
> > > How does this patch look to you?
> >
> > Frankly, it looks unnecessarily complicated.  What's the rationale for
> > using COLUMNS=999 as a command prefix in every "eval", rather than
> > just declaring once
> >   local -x COLUMNS=999
> > at the start of the function??  Why rearrange the other declarations?
>
> TIL you can export parameters locally. Here's a new patch.

And since we're on the topic, this patch adds `-x` to `local` completion.
From 8742ba63ebccbba1c367663094e0f1c10dd2107b Mon Sep 17 00:00:00 2001
From: Marlon Richert <marlon.richert@xxxxxxxxx>
Date: Tue, 10 Aug 2021 22:11:28 +0300
Subject: [PATCH] Complete `local -x`

---
 Completion/Zsh/Command/_typeset | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Completion/Zsh/Command/_typeset b/Completion/Zsh/Command/_typeset
index 3f7de9706..5f7fb24fa 100644
--- a/Completion/Zsh/Command/_typeset
+++ b/Completion/Zsh/Command/_typeset
@@ -69,7 +69,7 @@ case ${service} in
     allargs[i]='-i+[specify arithmetic base for output]:: :_guard "[0-9]#" base' \
   ;;
   readonly) use="${use/r/}" ;;
-  local) use="${use/[fkz]/}" ;&
+  local) use="${use/[fgkz]/}" ;;
   export) use="${${use//[gkz]/}/x/}" ;;
 esac
 
-- 
2.30.1 (Apple Git-130)



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