On Feb 27, 12:17 am, hsitz <[email protected]> wrote: > I'm having a problem with VIm recognizing the fold level lines in a > document. I have a syntax file with a number of folded regions > defined. I can consistently add a new line in a way that makes Vim > fail to adjust the new line to have the proper fold level. If I > execute 'syn sync fromstart' manually (or any other sync command) the > foldlevel gets adjusted properly.
I've made a short video that illustrates the problem. The problem has nothing to do with highlighting, which never falls out of sync. It has to do with the recalculation of the fold level of an outer region when a new nested region is added. The outer region does not automatically get its fold level recalculated so it falls out of synch. The fold levels are always properly assigned when I use a manual syncing method (e.g., syn sync fromstart) or even when I simply alter the outer regions' line, e.g., insert a character on it. It appears that the synching of fold levels never adjusts automatically on lines above the line where text is being entered. My understanding was that the syntax synching would move up and/or down in file automatically readjusting so text in the area being viewed was accurately synched, but that is definitely not happening for my fold levels (although all the highlighting is synched automatically). A video illustrating the problem is here: http://www.plainspokenfinancial.com/prob.htm Here's a copy of the syntax file. The sytax is for outlining text documents, not coding. The main levels are OL[1-9]. Each level is nested within a level of higher number, e.g., OL2 is nested within an OL1 region. Then there are two sets of "text" regions, NT[1-9] and BT [1-9]. These elements are also nested within an outer region, but are defined to begin on same line as the outer region so they end up collapsing independently of other OLx regions nested within same outer region. You can see example of this in the video: http://www.plainspokenfinancial.com/vo_base.vim Any info would be appreciated. I'm not sure if this is a bug or limitation of Vim, or some mistake I'm making in defining the syntax files (which work great except for this), or something else. Thanks, Herb Sitz --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
