[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [wish] copy-pasting indented code when auto-indent is on
From: |
Brand Huntsman |
Subject: |
Re: [wish] copy-pasting indented code when auto-indent is on |
Date: |
Fri, 3 Jan 2020 17:24:47 -0700 |
On Fri, 3 Jan 2020 15:29:58 +0100
Benno Schulenberg <address@hidden> wrote:
> Inspecting the patch, I don't see why you need the do_nothing()
> function and the BRACKETED_PASTE_MARKER symbol. The escape-sequence
> parsing does not need to return any value -- by default it returns
> ERR, which means that the sequence gets ignored, which is what we
> want in this case (at least, for the basic feature of toggling the
> 'bracketed_paste' boolean on and off).
Returning ERR causes an unknown sequence error when pasting, and doesn't
display the last pasted line, until a key is typed.
> it deserves a separate small function, disable_bracketed_paste(),
Done.
Attached patch also fixes pastes that include non-printable characters.
Pasting multiple lines in a search prompt would search for the first line and
dump all remaining lines in the buffer. With bracketed paste, prompts ignore
and beep when non-printable characters are pasted.
Pasting control codes and escape sequences in the buffer (and prompts) would
execute them, which might be undesirable. With bracketed paste, it only allows
tab, LF and CR into the buffer.
It might be possible to enable verbatim mode and paste anything into the buffer
or prompts. Such as pasting text that contains tabs or binary data into the
search prompt, or pasting binary data into the buffer. But prompts should
always ignore LF and beep. Or maybe verbatim mode could be automatic when
bracketed_paste is set. I haven't looked to see if either would be an easy task.
The only problem I can see is that it breaks automation by preventing someone
from pasting sequences into the buffer that would perform a set of commands.
bracketed-paste.patch
Description: Text Data