From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18089 invoked by alias); 13 Jan 2016 01:01:50 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37594 Received: (qmail 8272 invoked from network); 13 Jan 2016 01:01:49 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 Date: Wed, 13 Jan 2016 01:01:47 +0000 From: Daniel Shahaf To: Zsh hackers list Subject: Re: _history-complete-older problems with $( Message-ID: <20160113010147.GA4699@tarsus.local2> References: <160111161501.ZM5305@torch.brasslantern.com> <160112113928.ZM9065@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <160112113928.ZM9065@torch.brasslantern.com> User-Agent: Mutt/1.5.23 (2014-03-12) Bart Schaefer wrote on Tue, Jan 12, 2016 at 11:39:28 -0800: > On Jan 12, 2:09pm, Sebastian Gniazdowski wrote: > } Why second comadd, and > } what does "${(@)${(@)found#$PREFIX}%$SUFFIX}" do? > > Suppose you have "$(" on the line, and the completion is $((1+2)). The > $found array will contain "$((1+2))" (and possibly other elements). In > the setup to at the beginning of _widen_for_history, PREFIX="$(" was > assigned (that $left[-1]). So now we need to remove "$(" from the > values in $found to get the actual string to insert to finish the word, > i.e., "(1+2))". Similarly we would need to remove $SUFFIX (taken from > $right) from the end of the values if there were one. > That seems to always behave as though COMPLETE_IN_WORD is set, regardless of the value of the option.