Fix code review notes on 'norm zo':
- Only issue 'zo' if there is any fold at all. - Correct possible bug, code was using 'start_lnum' var, but it was changed/incremented which could lead to wrong results. - Use bang with norm, to prevent user re-mapping interfere with standard ones.
This commit is contained in:
parent
5247de4a0b
commit
77fca9080c
@ -1175,6 +1175,8 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header,
|
|||||||
let whitespaces_in_first_line = ''
|
let whitespaces_in_first_line = ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let start_of_listing = start_lnum
|
||||||
|
|
||||||
" write new listing
|
" write new listing
|
||||||
let new_header = whitespaces_in_first_line
|
let new_header = whitespaces_in_first_line
|
||||||
\ . substitute(g:vimwiki_rxH1_Template,
|
\ . substitute(g:vimwiki_rxH1_Template,
|
||||||
@ -1193,9 +1195,9 @@ function! vimwiki#base#update_listing_in_buffer(strings, start_header,
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Open fold, if needed
|
" Open fold, if needed
|
||||||
if !is_fold_closed
|
if !is_fold_closed && foldclosed(start_of_listing)
|
||||||
exe start_lnum
|
exe start_of_listing
|
||||||
norm zo
|
norm! zo
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if is_cursor_after_listing
|
if is_cursor_after_listing
|
||||||
|
Loading…
Reference in New Issue
Block a user