Björn Winckler wrote:

> I have been notified of two insert mode paste problems in MacVim which
> I assume also apply to all other GUIs.  When I say "paste", I mean
> "paste using the menu Edit->Paste, or the toolbar".
> 
> 1. In block mode, assume the + register contains "HI" and your buffer
> looks like
> 
> aa bb
> aa bb
> 
> Enter block-wise visual mode and select the block of "b"s.  Hit I,
> paste, then Esc.  The result is
> 
> aa HIbb
> aa bb
> 
> even though it should be
> 
> aa HIbb
> aa HIbb

This indeed looks wrong.

> 2. Assume the + register contains lines of text (i.e. with <CR> in
> there somewhere) and your buffer is
> 
> a b
> 
> Now put cursor on the "b", hit i, then paste.  The result is
> 
> the lines
> of text that was
> in your + register
> a b
> 
> when I (and several others) expect it to be
> 
> a the lines
> of text that was
> in your + register
> b
> 
> or something like it (it would be nice with no newline before the
> "b").  The point is that the text should be insert in between the "a"
> and "b" if the cursor was there when you pasted.

This was discussed last week.  When there is a CR or NL in the copied
text then Vim handles it linewise.  There was a proposal to change this
to only use linewise when the text ends in a CR or NL.

> Now for some solutions:
> 
> a) use <C-R>+ to paste:  this works but lines of formatted text
> usually ends up being a complete mess afterwards (the indentation
> changes)
> 
> b) use <C-R><C-O>+ to paste:  this fixes 1 but not 2, formatting is ok
> though
> 
> c) use <C-O>:set paste<CR><C-R>+<C-O>:set nopaste<CR>
> this seems to fix all situations
> 
> 
> Does anybody have any comments on (c)?  Improvements?
> 
> Why is (c) not the default for pasting in all GUIs?  Or something
> similar...?

It should indeed work like the 'paste' option is set.  Saving it,
setting it and then restoring it would be the best.

-- 
hundred-and-one symptoms of being an internet addict:
88. Every single time you press the 'Get mail' button...it does get new mail.

 /// 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_use" 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

Reply via email to