Fix bug: saving a page would err out trying to open fold if folds are disabled or are configured differently.
This commit is contained in:
parent
77fca9080c
commit
c2b0fd843b
@ -1152,7 +1152,7 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header,
|
|||||||
let lines_diff = 0
|
let lines_diff = 0
|
||||||
|
|
||||||
if already_there
|
if already_there
|
||||||
let is_fold_closed = ( foldclosed(start_lnum) > 1 )
|
let is_fold_closed = ( foldclosed(start_lnum) > -1 )
|
||||||
" delete the old listing
|
" delete the old listing
|
||||||
let whitespaces_in_first_line = matchstr(getline(start_lnum), '\m^\s*')
|
let whitespaces_in_first_line = matchstr(getline(start_lnum), '\m^\s*')
|
||||||
let end_lnum = start_lnum + 1
|
let end_lnum = start_lnum + 1
|
||||||
@ -1195,7 +1195,7 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header,
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Open fold, if needed
|
" Open fold, if needed
|
||||||
if !is_fold_closed && foldclosed(start_of_listing)
|
if !is_fold_closed && ( foldclosed(start_of_listing) > -1 )
|
||||||
exe start_of_listing
|
exe start_of_listing
|
||||||
norm! zo
|
norm! zo
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user