From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18989 invoked by alias); 15 Jan 2016 06:26:53 -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: 37636 Received: (qmail 18487 invoked from network); 15 Jan 2016 06:26:50 -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: Fri, 15 Jan 2016 06:26:46 +0000 From: Daniel Shahaf To: Sebastian Gniazdowski Cc: Zsh hackers list Subject: Re: _history-complete-older problems with $( Message-ID: <20160115062646.GB13897@tarsus.local2> References: <160111161501.ZM5305@torch.brasslantern.com> <160112113928.ZM9065@torch.brasslantern.com> <20160113010147.GA4699@tarsus.local2> <160112180141.ZM9984@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sebastian Gniazdowski wrote on Thu, Jan 14, 2016 at 10:52:14 +0100: > PS. I used the "find LBUFFER myself" approach to handle following case > better ("|" is cursor): > > % $(( 0 |+ 1 )) > > Doing ${(z)LBUFFER} and then (z) on right part of BUFFER would produce > SUFFIX="+" instead of "+ 1 ))". If I find the word in ${(z)BUFFER} > and divide it into two halves myself, then I have PREFIX="$(( 0 " > SUFFIX "+ 1 ))". However, following case works better with LBUFFER > approach: > > % ${|a some other $words > > With LBUFFER approach, PREFIX="${" SUFFIX="a" and that's better than > PREFIX="${" SUFFIX="a some other $words". I can of course respect > no_complete_in_words and do PREFIX="${a" SUFFIX="". > > I'm currently looking for a way to choose better strategy, maybe > someone has some ideas? You could have the widget try both strategies.