--- Begin Message ---On 20:12 Sun 28 Oct , Bram Moolenaar wrote: > > Marcin Szamotulski wrote: > > > Here is a way to crash vim (vim -u NONE --noplugin). > > > > Set an autocommand: > > > > au BufUnload * :call setloclist(0, [{'bufnr':1, 'lnum':1, 'col':1, 'text': > > 'tango down'}]) > > > > Now run: > > > > :lvimgrep /.*/ *.txt > > > > And vim goes down. > > I can reproduce it. > > > Should lvimgrep trigger BufUnload autocommands? Where it is useful? > > Vimgrep works by loading the file into a buffer. That triggers > autocommands to be able to search in compressed files and handles > encoding conversions. BufUnload may be needed to undo the effect of > BufRead autocommands. > > I'll put this on the todo list, but it's unlikely that I will be able to > fix it soon. I hope someone can make a patch. > > -- > The goal of science is to build better mousetraps. > The goal of nature is to build better mice. > > /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ > /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ > \\\ an exciting new programming language -- http://www.Zimbu.org /// > \\\ help me help AIDS victims -- http://ICCF-Holland.org ///That's fine. I found a workaround for my case. I found this since my filetype plugin (for latex files) was using lvimgrep on BufUnload event. My script was nice enough to restore the user location list, and this was producing the error. The work a round that I made is to read file with readfile() and then make a loop over its lines, but I think this is slower than using vimgrep. Best regards, Marcin
--- End Message ---
