From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28369 invoked by alias); 1 Sep 2015 10:19:22 -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: 36365 Received: (qmail 1104 invoked from network); 1 Sep 2015 10:19:21 -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 X-AuditID: cbfec7f4-f79c56d0000012ee-0a-55e57ba6d2be Date: Tue, 01 Sep 2015 11:19:15 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Bug: magic-space and expand-history delete part of line since 5.0.8 Message-id: <20150901111915.35ef2407@pwslap01u.europe.root.pri> In-reply-to: References: Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCLMWRmVeSWpSXmKPExsVy+t/xK7rLqp+GGvR917E42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGXf/9jIWtHJWvOo+ytbA+Jqti5GTQ0LAROLcis/MELaYxIV7 64HiXBxCAksZJQ5tWsEO4cxgkvi46xSUs5VRYv7L+YwgLSwCqhJd03aD2WwChhJTN80Gs0UE xCXOrj3PAmILCwRIXJv/DGwFr4C9xOLV/8DinALBEvdbr4LVCwHVtJxaA3YSv4C+xNW/n5gg TrKXmHnlDCNEr6DEj8n3wHqZBbQkNm9rYoWw5SU2r3nLDDFHXeLG3d3sExiFZiFpmYWkZRaS lgWMzKsYRVNLkwuKk9JzDfWKE3OLS/PS9ZLzczcxQsL2yw7GxcesDjEKcDAq8fB2fHwSKsSa WFZcmXuIUYKDWUmE907V01Ah3pTEyqrUovz4otKc1OJDjNIcLErivHN3vQ8REkhPLEnNTk0t SC2CyTJxcEo1MPLw/Skrjr564OftrJYo6wjBmd/MRQ415m+VC7r4oa5FMFJy99eE/l4rzfs5 +6/q/jJPyPx/OvNIyBHuu36zL07aY/HZLHjh6uvZfEtOHF30Jdvtq53XitQrsTN6wg+s4/r2 mH3OD974tQyKtrujdx6/eWLmE56T0+3Y/r04c8hkgfi8upu3i4SUWIozEg21mIuKEwEUEidH VwIAAA== On Mon, 31 Aug 2015 19:32:23 -0700 Jacob Niehus wrote: > Since zsh 5.0.8, using magic-space or expand-history can delete part of the > command line for no apparent reason. This does not occur in 5.0.7 or 5.0.5. > > To reproduce: > > $ zsh -f > $ bindkey ' ' magic-space > > type this: > > $ vim =(ls) -c 'foo' > > move the cursor between 's)' and type '|' then space, and it changes to this: > > $ vim =(ls| ) > > "-c 'foo'" has been deleted. This function is low-level enough, and ctxtlex() already nasty enough, that I hope the following is good enough. It would be good to add a test for this, but I think this is way beyond my interactive-test-fu. pws diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index 97bdcc0..b1a6f9e 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -2812,6 +2812,8 @@ doexpandhist(void) do { ctxtlex(); } while (tok != ENDINPUT && tok != LEXERR); + if (tok == LEXERR) + lexstop = 0; while (!lexstop) hgetc(); /* We have to save errflags because it's reset in zcontext_restore. Since *