9090be4
To: vim-dev@vim.org
9090be4
Subject: Patch 7.0.012
9090be4
Fcc: outbox
9090be4
From: Bram Moolenaar <Bram@moolenaar.net>
9090be4
Mime-Version: 1.0
9090be4
Content-Type: text/plain; charset=ISO-8859-1
9090be4
Content-Transfer-Encoding: 8bit
9090be4
------------
9090be4
9090be4
Patch 7.0.012
9090be4
Problem:    Using the matchparen plugin, moving the cursor in Insert mode to a
9090be4
	    shorter line that ends in a brace, changes the preferred column
9090be4
Solution:   Use winsaveview()/winrestview() instead of getpos()/setpos().
9090be4
Files:	    runtime/plugin/matchparen.vim
9090be4
9090be4
9090be4
*** ../vim-7.0.011/runtime/plugin/matchparen.vim	Wed May 10 15:22:55 2006
9090be4
--- runtime/plugin/matchparen.vim	Thu May 11 14:42:55 2006
9090be4
***************
9090be4
*** 1,6 ****
9090be4
  " Vim plugin for showing matching parens
9090be4
  " Maintainer:  Bram Moolenaar <Bram@vim.org>
9090be4
! " Last Change: 2006 Apr 27
9090be4
  
9090be4
  " Exit quickly when:
9090be4
  " - this plugin was already loaded (or disabled)
9090be4
--- 1,6 ----
9090be4
  " Vim plugin for showing matching parens
9090be4
  " Maintainer:  Bram Moolenaar <Bram@vim.org>
9090be4
! " Last Change: 2006 May 11
9090be4
  
9090be4
  " Exit quickly when:
9090be4
  " - this plugin was already loaded (or disabled)
9090be4
***************
9090be4
*** 90,96 ****
9090be4
    " Find the match.  When it was just before the cursor move it there for a
9090be4
    " moment.
9090be4
    if before > 0
9090be4
!     let save_cursor = getpos('.')
9090be4
      call cursor(c_lnum, c_col - before)
9090be4
    endif
9090be4
  
9090be4
--- 90,96 ----
9090be4
    " Find the match.  When it was just before the cursor move it there for a
9090be4
    " moment.
9090be4
    if before > 0
9090be4
!     let save_cursor = winsaveview()
9090be4
      call cursor(c_lnum, c_col - before)
9090be4
    endif
9090be4
  
9090be4
***************
9090be4
*** 102,108 ****
9090be4
    let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
9090be4
  
9090be4
    if before > 0
9090be4
!     call setpos('.', save_cursor)
9090be4
    endif
9090be4
  
9090be4
    " If a match is found setup match highlighting.
9090be4
--- 102,108 ----
9090be4
    let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
9090be4
  
9090be4
    if before > 0
9090be4
!     call winrestview(save_cursor)
9090be4
    endif
9090be4
  
9090be4
    " If a match is found setup match highlighting.
9090be4
*** ../vim-7.0.011/src/version.c	Thu May 11 19:24:16 2006
9090be4
--- src/version.c	Thu May 11 19:29:58 2006
9090be4
***************
9090be4
*** 668,669 ****
9090be4
--- 668,671 ----
9090be4
  {   /* Add new patch number below this line */
9090be4
+ /**/
9090be4
+     12,
9090be4
  /**/
9090be4
9090be4
-- 
9090be4
Corduroy pillows: They're making headlines!
9090be4
9090be4
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
9090be4
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
9090be4
\\\        download, build and distribute -- http://www.A-A-P.org        ///
9090be4
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///