From 7969810b494c6ea66fd353b9071fb4d3fe06fc07 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Fri, 26 Oct 2018 16:35:02 +0200 Subject: [PATCH] Fix losing highlighting after VimwikiAll2HTML Apparently, switching buffers in connection with disabled events caused the highlighting to disappear. Solution: use the :wa command to save all buffers. A disadvantage is that now also non-Vimwiki buffers are saved, but I think that is bearable. --- autoload/vimwiki/html.vim | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim index bce5465..0fd68d6 100644 --- a/autoload/vimwiki/html.vim +++ b/autoload/vimwiki/html.vim @@ -204,13 +204,6 @@ function! s:subst_func(line, regexp, func, ...) endfunction -function! s:save_vimwiki_buffer() - if &filetype ==? 'vimwiki' && filewritable(expand('%')) - silent update - endif -endfunction - - function! s:process_date(placeholders, default_date) if !empty(a:placeholders) for [placeholder, row, idx] in a:placeholders @@ -1586,9 +1579,11 @@ function! vimwiki#html#WikiAll2HTML(path_html) echomsg 'Vimwiki: Saving Vimwiki files ...' let save_eventignore = &eventignore let &eventignore = "all" - let cur_buf = bufname('%') - bufdo call s:save_vimwiki_buffer() - exe 'buffer '.cur_buf + try + wall + catch + " just ignore errors + endtry let &eventignore = save_eventignore let path_html = expand(a:path_html)