Commit 7f19bdb3 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Dissolve the fold tree before re-parsing

parent bd7c20d9
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -167,6 +167,14 @@ function! s:newFold(type, indent, ...)
		    \ "child was not found in parent"
	endfunction

	function fold.dissolve()
		for child in self.children
			call child.dissolve()
		endfor
		let self.parent = 0
		let self.children = 0
	endfunction

	function fold.abort()
		let parent = self.parent
		call parent.remove_child(self)
@@ -205,6 +213,9 @@ function! s:newFold(type, indent, ...)
endfunction

function! s:parsebuffer()
	if exists('b:root.dissolve')
		call b:root.dissolve()
	endif
	let b:root = s:newFold('file', 0)
	let b:root.has_docstring = 0
	let cur_fold = b:root