Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: highlight pasted text
- X-seq: zsh-workers 36017
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- Subject: Re: PATCH: highlight pasted text
- Date: Sat, 8 Aug 2015 21:51:21 +0000
- Cc: zsh-workers@xxxxxxx
- 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=
- In-reply-to: <6704.1437328639@thecus.kiddle.eu>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <mo6325$r5k$1@ger.gmane.org> <7277.1437023995@thecus.kiddle.eu> <150716131504.ZM18155@torch.brasslantern.com> <modfdp$crn$1@ger.gmane.org> <150718110859.ZM4405@torch.brasslantern.com> <19088.1437274234@thecus.kiddle.eu> <mog49m$8en$1@ger.gmane.org> <6704.1437328639@thecus.kiddle.eu>
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 <accept-line> 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?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author