From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11298 invoked by alias); 8 Aug 2015 22:02:30 -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: 36017 Received: (qmail 2748 invoked from network); 8 Aug 2015 22:02:26 -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,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=YHha7QEaZtFomgSK/oLFCkv/31A=; b=KvjOTZ VZneL55W73bb279ifg6mRMtKRH45w+1oy/R8awMqHdmxpjghE2nz3jLS4slQLUI5 iiid+nshwD/P7NPux2gla+la4q1Fvr2MxDKPe7PdhLYZImt9/LQU6aFNB6JvKnp1 Hmj2a+nxWTMS8ZbU9nXwsRkPjH0odKHHqxXCA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=YHha7QEaZtFomgSK/oLFCkv/31A=; b=WTfjz WoPZXfOu1AGKJh2X8sxq9k1RuJ2ewfbxqD2DI/MDnJvCR+eka8MHRKtQO6ji1ZMB VR/A+JjAxDomXKYk+I/W0Kt3U+MA1hT7WEFmt1dxvPCETiZeipqpAVuMh9D5WDx8 J46rjeHaH2t5Na4sRCwqZsu0EVuC8l9dHUDa0M= X-Sasl-enc: 5n5YCWooHWC5eVb1yxAdNJ+n1dBFf+25hUd1hIiqdtcs 1439070691 Date: Sat, 8 Aug 2015 21:51:21 +0000 From: Daniel Shahaf To: Oliver Kiddle Cc: zsh-workers@zsh.org Subject: Re: PATCH: highlight pasted text Message-ID: <20150808215121.GA2064@tarsus.local2> References: <7277.1437023995@thecus.kiddle.eu> <150716131504.ZM18155@torch.brasslantern.com> <150718110859.ZM4405@torch.brasslantern.com> <19088.1437274234@thecus.kiddle.eu> <6704.1437328639@thecus.kiddle.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6704.1437328639@thecus.kiddle.eu> User-Agent: Mutt/1.5.21 (2010-09-15) Oliver Kiddle wrote on Sun, Jul 19, 2015 at 19:57:19 +0200: > 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. ... > + /* chop a final newline if it's insertion would be hard to > + * distinguish by the user from the line being accepted */ Over here I'm using zle_highlight=(paste:standout). It's unobtrusive, doesn't munge the pasted text, and on at least one occasion reminded me to invoke after pasting. Maybe set that by default instead? --- Alternatively, could I do something like: bracketed-paste() { zle .bracketed-paste zle .yank-pop } zle -N bracketed-paste to disable newline trimming, if this patch is applied?