From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11910 invoked by alias); 18 Jul 2015 02:38:38 -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: 35814 Received: (qmail 2457 invoked from network); 18 Jul 2015 02:38:35 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1437186783; bh=8/Sr3woAxp6MWmyW0dh/9SUZ/b8cDNNxXDBoIERB8Iw=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=lFYjozSBygyZkmG2qi/G5LBp3ev/aMYLs10enAllC892wiI4vkUY5F/AJ7lDGjqObvkGhajch+eXLbQpa8rtLmh0rBrNs8KpJM+ScQv2zjHsdU3woUCClv02dTYd32uvL1+ESs9psmus/B3t/a+K62Xe97EeDkCWECuQ+LcCcLQNhTImHjMJhEhCF2O7SPYvFebxeDT9rpvpk3sZw+G4BncXkrhzrFAQuRD6e17XDh9+dwmOHRSZBSYQPfojYVICZ5CGnQO6qprP1ssSbuvz7Ytj4LWgI53y7MaSWG59bPoei2wxJmcBPQtZ80Jrkta4JYvhQyAjnEO30MMp4mt/kg== X-Yahoo-Newman-Id: 830186.61403.bm@smtp146.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: EysutE0VM1mbnlq5CwE6_EL8s4Goc525q_Ec.AjFxW1eVCk jXr9D_EiBK_EqfDMr_JtVNY24tWh4yxWowkP9wc6W2Q1Irx.SqiePMzdGXWW T39q.o0REH4i7MOBkNhNv8joFKDZ.2GKpZFFIFLUsrjrhDcvqiez1Y_r3GW8 Y.f_pP12DoU4uxDKqQUbgRhzM31IzvDEiScV4GZDpT.se0Ox62ZTm2QxSist GiXCO04vu1GvrykKlAm9vHYvOiES2SNsCD4FVp9blKHUdmMW4MZe5WphmsIf X6FsSqWkt6KYMXv6Tp7j3KGAyAa32GHmWGhmKFPQzhJfAf5r8cD6J_cf94ZS DNSvpN96L98KDkyqJXm5I34m9N8R_LCYFqle1hVmttrZ.FxYmNcvLEM.iR4U .ksd6EjC_Q.txeUL53J2hBsDwN3MKUhNM6mgzFuYP2iaNPG_rbDNbhDjHZn2 ywIZID.enwx79oL7WNNSiBBvCXF5bJ4hkrQMZZWRljyOm9KD2djW.dj4xraz oD_SsTwRykmYdtA8Ibl_bqMsmCprREA-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: From: Oliver Kiddle References: <7277.1437023995@thecus.kiddle.eu> To: zsh-workers@zsh.org Subject: Re: bracketed paste MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14645.1437186782.1@thecus.kiddle.eu> Date: Sat, 18 Jul 2015 04:33:02 +0200 Message-ID: <14646.1437186782@thecus.kiddle.eu> Yuri D'Elia wrote: > I would say a better improvement would be to remove any trailing empty > lines. Something like /(\n\s*$)+/. > In that scenario, maybe a "paste_trimmed" style would be better. It > avoids the kludges, and it's obvious: either you want literal paste, or > you don't want excess whitespace around. My concern is the average user that doesn't configure this. At the moment people are used to pasted newlines being accepted. If with 5.0.9, they paste a single line command including a trailing newline, there is no visible clue to tell them that things have changed: the cursor sits at the beginning of the next line and the user wonders for a few seconds why their command is taking so long. Like Bart, I'd rather the text is not altered. Sometimes I really want it verbatim and I can't write a widget to unalter it. Stripping just a single final newline wouldn't bother me greatly, however and it would mostly solve to concern I described above. There may be other solutions. For example I quite like the effect you get by putting normal characters in POSTEDIT followed by a carriage return, some examples: POSTEDIT+=$' Please wait...\r' POSTEDIT+=$'\u2588\u231b\r' POSTEDIT+=$'\u2584\b' (note that there seems to be a bug that we aren't doing unmeta() on postedit so you might need the patch below for these). Anyway, I'm not sure that a style achieves much because it isn't hard to write a custom widget and a widget is more flexible. The trick of using a prefix key also means you can have a selection: raw, quoted, whitespace removed, ${(Z.C.)var} for comment removal etc. Oliver diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index c13e3a0..e610ae1 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -1865,7 +1865,7 @@ trashzle(void) clearflag = listshown = 0; } if (postedit) - fprintf(shout, "%s", postedit); + fprintf(shout, "%s", unmeta(postedit)); fflush(shout); resetneeded = 1; if (!(zlereadflags & ZLRF_NOSETTY))