Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: highlight pasted text



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