Blob Blame History Raw
To: vim-dev@vim.org
Subject: Patch 7.0.012
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 7.0.012
Problem:    Using the matchparen plugin, moving the cursor in Insert mode to a
	    shorter line that ends in a brace, changes the preferred column
Solution:   Use winsaveview()/winrestview() instead of getpos()/setpos().
Files:	    runtime/plugin/matchparen.vim


*** ../vim-7.0.011/runtime/plugin/matchparen.vim	Wed May 10 15:22:55 2006
--- runtime/plugin/matchparen.vim	Thu May 11 14:42:55 2006
***************
*** 1,6 ****
  " Vim plugin for showing matching parens
  " Maintainer:  Bram Moolenaar <Bram@vim.org>
! " Last Change: 2006 Apr 27
  
  " Exit quickly when:
  " - this plugin was already loaded (or disabled)
--- 1,6 ----
  " Vim plugin for showing matching parens
  " Maintainer:  Bram Moolenaar <Bram@vim.org>
! " Last Change: 2006 May 11
  
  " Exit quickly when:
  " - this plugin was already loaded (or disabled)
***************
*** 90,96 ****
    " Find the match.  When it was just before the cursor move it there for a
    " moment.
    if before > 0
!     let save_cursor = getpos('.')
      call cursor(c_lnum, c_col - before)
    endif
  
--- 90,96 ----
    " Find the match.  When it was just before the cursor move it there for a
    " moment.
    if before > 0
!     let save_cursor = winsaveview()
      call cursor(c_lnum, c_col - before)
    endif
  
***************
*** 102,108 ****
    let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
  
    if before > 0
!     call setpos('.', save_cursor)
    endif
  
    " If a match is found setup match highlighting.
--- 102,108 ----
    let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
  
    if before > 0
!     call winrestview(save_cursor)
    endif
  
    " If a match is found setup match highlighting.
*** ../vim-7.0.011/src/version.c	Thu May 11 19:24:16 2006
--- src/version.c	Thu May 11 19:29:58 2006
***************
*** 668,669 ****
--- 668,671 ----
  {   /* Add new patch number below this line */
+ /**/
+     12,
  /**/

-- 
Corduroy pillows: They're making headlines!

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///