Lech Lorens wrote:
> Problem:
> In certain circumstances folds get messed up if a file that is edited in
> the not-current tab is modified from outside of Vim.
>
> Steps to reproduce:
> In Vim open two files with the following contents:
>
> file1.txt:
> #v+
> line1
> line2 [[[
> line3
> line4
> line5
> line6 ]]]
>
> vim: fdm=marker fmr=[[[,]]] fdc=3
> #v-
>
> file2.txt:
> #v+
> line1 [[[
> line2
> line3 ]]]
> line4 [[[
> line5
> line6 ]]]
>
> vim: fdm=indent sw=1 fdc=3
> #v-
>
> $ vim -p file1.txt file2.txt
>
> The fold column in the first tab shows one fold: <2,6>.
> From outside of Vim modify the change time of file2.txt:
> $ touch file2.txt
>
> In Vim:
> :checktime
>
> Although file1.txt has not been modified, the fold column in the first
> tab shows two folds: <1,3> and <4,6>,
>
> Solution:
> Restore folds after reading the file identified to have been modified.
Thanks for the clear explanation and the patch.
I wonder if this is the right way to solve it. Perhaps when reloading a
buffer we should "lock" the folding? In fact all window-local stuff
should be locked.
The ultimate solution would be to stop using an arbitrary window for
executing the buffer autocommands. Unfortunately one can write
autocommands that break when using some kind of hidden window.
--
DENNIS: You can't expect to wield supreme executive power just 'cause some
watery tart threw a sword at you!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- 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 ///
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---