To: [email protected]
Subject: Patch 6.3b.006
Fcc: outbox
From: Bram Moolenaar <[email protected]>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 6.3b.006
Problem:    When using "mswin.vim", CTRL-V in Insert mode leaves cursor before
           last pasted character.  (Mathew Davis)
Solution:   Use the same Paste() function as in menu.vim.
Files:      runtime/mswin.vim


*** ../vim-6.3b.005/runtime/mswin.vim   Sun May 16 22:38:59 2004
--- runtime/mswin.vim   Wed May 26 17:11:52 2004
***************
*** 1,7 ****
 " Set options and add mapping such that Vim behaves a lot like MS-Windows
 "
 " Maintainer: Bram Moolenaar <[email protected]>
! " Last change:        2003 May 17

 " set the 'cpoptions' to its Vim default
 if 1  " only do this when compiled with expression evaluation
--- 1,7 ----
 " Set options and add mapping such that Vim behaves a lot like MS-Windows
 "
 " Maintainer: Bram Moolenaar <[email protected]>
! " Last change:        2004 May 26

 " set the 'cpoptions' to its Vim default
 if 1  " only do this when compiled with expression evaluation
***************
*** 36,47 ****
 " Pasting blockwise and linewise selections is not possible in Insert and
 " Visual mode without the +virtualedit feature.  They are pasted as if they
 " were characterwise instead.
 if has("virtualedit")
   nnoremap <silent> <SID>Paste :call <SID>Paste()<CR>
   func! <SID>Paste()
     let ove = &ve
     set ve=all
!     normal `^"+gPi
     let &ve = ove
   endfunc
   inoremap <script> <C-V>     x<BS><Esc><SID>Pastegi
--- 36,56 ----
 " Pasting blockwise and linewise selections is not possible in Insert and
 " Visual mode without the +virtualedit feature.  They are pasted as if they
 " were characterwise instead.
+ " Note: the same stuff appears in menu.vim.
 if has("virtualedit")
   nnoremap <silent> <SID>Paste :call <SID>Paste()<CR>
   func! <SID>Paste()
     let ove = &ve
     set ve=all
!     normal `^
!     if @+ != ''
!       normal "+gP
!     endif
!     let c = col(".")
!     normal i
!     if col(".") < c   " compensate for i<ESC> moving the cursor left
!       normal l
!     endif
     let &ve = ove
   endfunc
   inoremap <script> <C-V>     x<BS><Esc><SID>Pastegi
*** ../vim-6.3b.005/src/version.c       Wed May 26 16:41:23 2004
--- src/version.c       Wed May 26 17:13:11 2004
***************
*** 643,644 ****
--- 643,646 ----
 {   /* Add new patch number below this line */
+ /**/
+     6,
 /**/

--
Your company is doomed if your primary product is overhead transparencies.
                               (Scott Adams - The Dilbert principle)

/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
\\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///