On Tuesday, December 22, 2015 at 6:58:07 AM UTC-6, Christian Brabandt wrote: > On Di, 22 Dez 2015, Dominique Pellé wrote: > > > Hi > > > > I'm using Charle's plugin for large files, version 5 (2013-11-25) > > available at: > > > > http://www.vim.org/scripts/script.php?script_id=1506 > > > > The plugin is causing the following error when trying to > > open 3 large files with the -o or -O options: > > > > E201: *ReadPre autocommands must not change current buffer" > > > > Steps to reproduce: > > > > 1) create 3 large files: > > > > $ yes 111 | head -10000000 > foo1 > > $ yes 222 | head -10000000 > foo2 > > $ yes 333 | head -10000000 > foo3 > > > > 2) open the 3 files with Vim, with LargeFile plugin installed, as follows: > > > > $ vim -o foo1 foo2 foo3 > > > > 3) notice the error message: > > > > E201: *ReadPre autocommands must not change current buffer > > Press ENTER or type command to continue > > > > After pressing ENTER, notice that file foo1 is loaded in top > > and bottom window, and middle window is empty. I would > > expect instead to see foo1 in top window, foo2 in middle > > window and foo3 in bottom window. > > > > I noticed the bug using vim-7.4.979 (huge) on Linux x86_64. > > Bug does not happen with Vim that comes with xubuntu-14.04 (7.4.52). > > > > Doing a bisection in git: > > > > 7.4.072 --> OK (no error) > > 7.4.073 --> Error E201 > > > > So the regression is introduced by this patch: > > > > commit f5a2fd880ae8f6225814209ab73783f65078a4d5 > > Author: Bram Moolenaar <[email protected]> > > Date: Wed Nov 6 05:26:15 2013 +0100 > > > > updated for version 7.4.073 > > Problem: Setting undolevels for one buffer changes undo in another. > > Solution: Make 'undolevels' a global-local option. (Christian > > Brabandt) > > Hm, this seems to be caused by the NoMatchParen command, that iterates > over all windows (but does not reset the cursor to the correct window > position) and disable parenthesis highlighting. > > I think, the matchparen plugin needs to be fixed: > > --- matchparen.vim.orig 2015-12-22 13:54:06.165428118 +0100 > +++ matchparen.vim.new 2015-12-22 13:56:30.760946989 +0100 > @@ -181,9 +181,9 @@ > endfunction > > " Define commands that will disable and enable the plugin. > -command! NoMatchParen windo silent! call matchdelete(3) | unlet! > g:loaded_matchparen | > - \ au! matchparen > -command! DoMatchParen runtime plugin/matchparen.vim | windo doau CursorMoved > +command! NoMatchParen let a=winnr() | windo silent! call matchdelete(3) | > unlet! g:loaded_matchparen | > + \ exe a. "wincmd w" | au! matchparen > +command! DoMatchParen runtime plugin/matchparen.vim | let a=winnr() | windo > doau CursorMoved | exe a. "wincmd w" > > let &cpo = s:cpo_save > unlet s:cpo_save > > > Perhaps we should add a windo! command, that does restore cursor positioning > (also for the other ..do commands)? >
Already discussed here: https://groups.google.com/d/topic/vim_dev/P8EyOpmNj5A/discussion Supposedly the latest unreleased version of LargeFile fixes it for LargeFile. I don't remember if I ever tried it. Regardless I'd support NoMatchParen restoring current window. But what about the alternate window as somebody pointed out in that other thread? -- -- You received this message from the "vim_dev" 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 --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
