Sung Pae wrote: > Upon closer inspection, I have the following observations about vim's > handling of foreign selections. > > > When pasting from the "* or "+ register, vim requests a selection > from the system clipboard. If the selection is not in a vim > selection format: > > - The mac, macosx, msdos, mswin, and qnx ports detect the presence > of a NL or CR (whatever is appropriate) _anywhere_ in the text and > switch the motion_type to MLINE > > - The riscos, gtk-x11, and x11 ports always set motion_type to MCHAR > > - In X, if the selection request fails, CUT_BUFFER0 is used, and is > also always set to MCHAR > > As you can see, vim's behavior wrt pasting foreign text is inconsistent. > Most of the non-X ports linewise paste multi-line selections, while the > X-based vims do not. > > While the X behavior is not a bug (it is actually explicitly > documented), I believe it is surprising in this instance. > > When I copy a large multi-line selection in an application in order to > transfer it into a vim buffer, I don't usually intend on engaging in a > delicate mid-line paste operation. The major non-X GUI ports evidently > share this view.
We need to think of various things the user wants to do and how he can make it work. I think it's not unusual to copy a few lines, starting halfway a line and ending halfway a line. E.g., a sentence that is split over multiple lines. And then the user would like to paste it somewhere inside an existing line. If we would make the selection linewise, the user would first have to break the line, paste the text linewise, then join the lines back together. This is possible, but a bit clumsy. I would rather use the linewise selection only when the text ends in a line break. I think in most situations the user can select the text either with or without a terminating NL. At least in xterm you can. If I understand the other remarks correctly, there are situations where it's not possible to get a terminating NL. That means the selection won't become linewise, thus we get the current behavior. That's not too bad. Depending on where the text is pasted, the user would have to insert a line break before and/or after the pasted text. The cursor should be at the end, thus if the user pastes in front of a line it's a matter of inserting a line break there. To make it consistent, we would also have to change the operating systems that currently find a NL or CR anywhere in the selection. I wonder if anybody would have a problem with that. -- Never go to the toilet in a paperless office. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- 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
