From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18656 invoked by alias); 19 Jul 2015 18:02:52 -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: 35834 Received: (qmail 18253 invoked from network); 19 Jul 2015 18:02: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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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=1437328640; bh=eUePEOjx0P3NZ3mkGwLY6232ugpIWiM9a8IH27yPR4M=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=jvuuAbPBtLKgFQBT/h3FmLQ1cf7IDyqv7906kZHDOOt6vhxHRdHesZq4FncvHf7pQRFIfKX0lS+9bbg8fql1SkAQ0oT0DzKadm4YpwaJ/YgyzI2BS+Dny4PucVSdkhlCDtz57jPu0q50yqxTAXWEsnS1gtBPYqBC3NsfATXPbVv5/Txmdq/Y83ZEYvKAsvaVFrBeuq50qUf7l6ObRcgqY3AoBvPfodG6FqX6Uq8ckz0CCcanVzvY9lsOXG9Sd0ywebMs8qs3Q2ETj2V7HvEVRx45knbMxv0NBoABYLnglB+84eakmT5QEaHJUSUGquj+RjYRw/tZlBBmMG6ay4j+Dg== X-Yahoo-Newman-Id: 184586.57897.bm@smtp121.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: hjRU53YVM1mTMBZx_oz2bnvJRh9YSW.e6lI..a81UPd4vdd RoSOHDDPeAVIspAHCsWFJj6H3g7mzicZt4xY4MvNe6lBFOUhDrQdPM04iSZn 3GW2Qpnh5zGY5lgx6Sh.BzgFhtIAxhq3hDVCiYNy0Yf8SgCyK3NuTINvuuXE BWcftqRApujySwk.2yj5Shwbk8mYo5BydHNiE4ROv40cZZ9fdtSqCYaBCKVy 1aBuT16aZq0j4mfrIsgcN_vVAA.XYMOh630.zZ9JzVFPWX384B7K8BIaBTGy JHMQvpzdItQ7tM5_JIhbYKrKjntB5GnuPtcG02ugQgjX0sNaWlQPw77fTXA6 bJLRzIipx_hGFWDyATWwfVRMa3eSIyq_esobaEE6Ds0z_GDrL9fNhyQPK98N baH4hf4D38b_FlBiCecoqxJ6HTD6T8AtDyIfIyV9Y149Y4O7y5sOhQiUfO9t s_znII95tm9QncD.uowNUL.6CeA.O.6tx1dsX24.1sFg.yUGkmBebjg5R65m t0p_Nvbd7qxiugmsJIYnv5_LdFrNRng-- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: From: Oliver Kiddle References: <7277.1437023995@thecus.kiddle.eu> <150716131504.ZM18155@torch.brasslantern.com> <150718110859.ZM4405@torch.brasslantern.com> <19088.1437274234@thecus.kiddle.eu> To: zsh-workers@zsh.org Subject: Re: PATCH: highlight pasted text MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6703.1437328638.1@thecus.kiddle.eu> Date: Sun, 19 Jul 2015 19:57:19 +0200 Message-ID: <6704.1437328639@thecus.kiddle.eu> Yuri D'Elia wrote: > But chopping off that newline if it's the last character... hmm, I still > think that's a good idea. How about the following? It only strips the newline when pasting at the end of the buffer with region inactive and only after putting the unadulterated string in the cut buffer. I've also added a note to the NEWS file about bracketed paste. > > does. Though emacs is perhaps not putting duplicates in. It'd be good if > > some actual emacs users could check that it all makes sense, however. > It matches the default behavior of 24.* at least. Good, thanks. Oliver diff --git a/NEWS b/NEWS index d515a60..6e78e30 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,10 @@ creates a local "scalar" containing the text "one word" and an array "array" containing the words "several" "words". +- The bracketed paste mode of newer terminal emulators is now supported. + This feature allows the shell to differentiate between pasted text and + typed-in characters that may include keys with associated functions. + Changes from 5.0.0 to 5.0.8 --------------------------- diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c index b040b97..1012fee 100644 --- a/Src/Zle/zle_misc.c +++ b/Src/Zle/zle_misc.c @@ -787,6 +787,11 @@ bracketedpaste(char **args) zmult = 1; if (region_active) killregion(zlenoargs); + /* chop a final newline if it's insertion would be hard to + * distinguish by the user from the line being accepted */ + else if ((zlecs + (insmode ? 0 : n - 1)) >= zlell && + wpaste[n-1] == ZWC('\n')) + n--; yankcs = yankb = zlecs; doinsert(wpaste, n); yanke = zlecs;