On Mon, 30 Jan 2017, Bram Moolenaar wrote:
I'm a little confused by this part in normal.c:
+ case K_PS: /* bracketed paste works like "a"ppend */
<MiddleMouse> pastes work like insert, as does insert mode <C-R><C-O> --
shouldn't these be consistent?
When Vim deals with the paste we know the mouse position, thus one can
point to a character to insert before, or after the last character to
append. With bracketed paste we don't know the mouse position, we only
have the cursor position. I think appending is the most common.
However, this makes it impossible to insert before the first column. We
could make it so that it inserts before the first column and otherwise
appends. This then makes it impossible to append after the first
character, but that's probably the best compromise.
The first column issue is how I'd noticed this, actually... I've had a
best-effort approximation of bracketed paste support in my vimrc for a
couple years now, and was comparing what I had with the native
implementation to see how badly it was going to break my muscle memory :)
Appending doesn't seem to me to be the common case, especially given the
inconsistency with everything else that performs a paste-like operation:
besides the aforementioned <MiddleMouse> and <C-R><C-O> (and variants),
there's also the default menu entries, the mswin.vim mappings, and the
paste#Paste() function, all of which use something akin to "+gP. A
'pasteappend' option (default: off) or similar might make sense, though.
The other significant difference I've run into is that Vim is now
swallowing pasted text in visual mode. I've been using mappings that
allow pastes in normal and visual modes by entering insert or replacing
the visually selected text, respectively -- although both rely on
'pastetoggle' and thus can't get back out of insert mode after the paste,
at least not without a bunch of extra hacks. Native support for both of
those operations would be pretty nice. Is the second bracketed_paste()
call in nv_edit() the reason for the current behavior, and would you be
amenable to changing the way these behave?
(Also, there's a todo.txt entry for bracketed paste that could be removed:
text starts with "xterm supports escape sequences to mark a paste".)
-Rob
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.