vimwiki

Personal wiki for vim
git clone https://github.com/vimwiki/vimwiki.git
Log | Files | Refs | README | LICENSE

commit 39b62398202885adb1ab95729debd9f31d8b4de2
parent fb5ea2886b6e8ef763128a97feb1005d4486e33b
Author: EinfachToll <istjanichtzufassen@googlemail.com>
Date:   Thu, 23 Oct 2014 12:18:28 +0200

Vim gets stuck when converting a read-only file

because it tries to write it beforehand.
Fix #81

Diffstat:
Mautoload/vimwiki/html.vim | 2+-
Mftplugin/vimwiki.vim | 8+++++---
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim @@ -204,7 +204,7 @@ function! s:subst_func(line, regexp, func, ...) " {{{ endfunction " }}} function! s:save_vimwiki_buffer() "{{{ - if &filetype == 'vimwiki' + if &filetype == 'vimwiki' && filewritable(expand('%')) silent update endif endfunction "}}} diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim @@ -242,13 +242,15 @@ endfunction "}}} " COMMANDS {{{ command! -buffer Vimwiki2HTML - \ silent noautocmd w <bar> + \ if filewritable(expand('%')) | silent noautocmd w | endif + \ <bar> \ let res = vimwiki#html#Wiki2HTML(expand(VimwikiGet('path_html')), \ expand('%')) - \<bar> + \ <bar> \ if res != '' | echo 'Vimwiki: HTML conversion is done, output: '.expand(VimwikiGet('path_html')) | endif command! -buffer Vimwiki2HTMLBrowse - \ silent noautocmd w <bar> + \ if filewritable(expand('%')) | silent noautocmd w | endif + \ <bar> \ call vimwiki#base#system_open_link(vimwiki#html#Wiki2HTML( \ expand(VimwikiGet('path_html')), \ expand('%')))