4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Using the matchparen plugin, moving the cursor in Insert mode to a
12 shorter line that ends in a brace, changes the preferred column
13 Solution: Use winsaveview()/winrestview() instead of getpos()/setpos().
14 Files: runtime/plugin/matchparen.vim
17 *** ../vim-7.0.011/runtime/plugin/matchparen.vim Wed May 10 15:22:55 2006
18 --- runtime/plugin/matchparen.vim Thu May 11 14:42:55 2006
21 " Vim plugin for showing matching parens
22 " Maintainer: Bram Moolenaar <Bram@vim.org>
23 ! " Last Change: 2006 Apr 27
26 " - this plugin was already loaded (or disabled)
28 " Vim plugin for showing matching parens
29 " Maintainer: Bram Moolenaar <Bram@vim.org>
30 ! " Last Change: 2006 May 11
33 " - this plugin was already loaded (or disabled)
36 " Find the match. When it was just before the cursor move it there for a
39 ! let save_cursor = getpos('.')
40 call cursor(c_lnum, c_col - before)
44 " Find the match. When it was just before the cursor move it there for a
47 ! let save_cursor = winsaveview()
48 call cursor(c_lnum, c_col - before)
53 let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
56 ! call setpos('.', save_cursor)
59 " If a match is found setup match highlighting.
61 let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
64 ! call winrestview(save_cursor)
67 " If a match is found setup match highlighting.
68 *** ../vim-7.0.011/src/version.c Thu May 11 19:24:16 2006
69 --- src/version.c Thu May 11 19:29:58 2006
73 { /* Add new patch number below this line */
79 Corduroy pillows: They're making headlines!
81 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
82 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
83 \\\ download, build and distribute -- http://www.A-A-P.org ///
84 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///