Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Global arrays in widgets
- X-seq: zsh-users 21158
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Global arrays in widgets
- Date: Sun, 17 Jan 2016 13:18:30 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=MS4a8cuUFAwmqNr55Yl/AwdtXu9+YTk+LTDUsp8SAnE=; b=tgo0Z3tNkRFL5EhtR3ofMImX/Ep+0ru/EK5McvWCM84ufG4LAMllzqVb6mbXR4mXEB VLVpixOPXa3UM3dW6FNFhIYIcLjeqMi1+JsF9/Oxd6dHeB2Oz2nmDewCgYIBumb47c36 WD3J7to2mpCbxgFT1SUs+4xnmHY/QWrDvxzO3cdpsS6jgTabsdKXuFwSSnKpN7vlA84Z 969jDHZFCE9yru0kArGPGR4jGnt4q5U/oUj2wyAPRAzvdGO8/0pWGwPU717U9UO128Ph 4SQJfAY1F09rrUGmPERQx5pEByB4Y9DrTQCCFuHy4/aoxkPg/DRt8bCqhAO5vyehpEsV 01rg==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hello,
I do typical trick to detect consecutive widget calls:
typeset -g __zew_csw_index __zew_csw_left __zew_csw_right
typeset -ga __zew_csw_found
if [ "$WIDGET" = "$LASTWIDGET" ]; then
(( __zew_csw_index ++ ))
else
(( __zew_csw_index = 1 ))
__zew_csw_left=...some initial value...
__zew_csw_right=...some initial value...
__zew_csw_found=( )
fi
But the variable __zew_csw_found doesn't survive between calls. I
tested various things and found that the only array that I can keep
between calls is reply. Why?
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author