Fix Document Compile Function in vim

Fixed non-escaped directory sequence (erroring on spaces in filenames)
and silent code execution.
This commit is contained in:
Marty Oehme 2020-02-04 20:38:47 +01:00
parent 667595d2fb
commit 804ae4005a
2 changed files with 7 additions and 6 deletions

View file

@ -1,23 +1,23 @@
function s:_compile(verbose, ...) function s:_compile(verbose, ...)
:execute(":w!") :execute(":w!")
if a:verbose if a:verbose
execute "!" . "compile" . " " . "%" . " " . join(a:000) execute "!" . "compile" . " " . "\"%\"" . " " . join(a:000)
else else
silent "!" . "compile" . " " . "%" . " " . join(a:000) silent execute "!" . "compile" . " " . "\"%\"" . " " . join(a:000)
endif endif
endfunction endfunction
function s:_open(verbose, ...) function s:_open(verbose, ...)
if a:verbose if a:verbose
execute "!" . "open-compiled" . " " . "%" . " " . join(a:000) execute "!" . "open-compiled" . " " . "\"%\"" . " " . join(a:000)
else else
silent "!" . "open-compiled" . " " . "%" . " " . join(a:000) silent execute "!" . "open-compiled" . " " . "\"%\"" . " " . join(a:000)
endif endif
endfunction endfunction
function s:_compileopen(verbose, ...) function s:_compileopen(verbose, ...)
call s:_compile(<bang>0, <f-args>) call s:_compile(a:verbose, join(a:000))
call s:_open(<bang>0, <f-args>) call s:_open(a:verbose, join(a:000))
endfunction endfunction
command -bang -nargs=* DocCompile call s:_compile(<bang>0, <f-args>) command -bang -nargs=* DocCompile call s:_compile(<bang>0, <f-args>)

View file

@ -1,5 +1,6 @@
" PLUGIN: vim-pandoc " PLUGIN: vim-pandoc
" handle markdown files with pandoc (and pandoc syntax!) " handle markdown files with pandoc (and pandoc syntax!)
let g:pandoc#modules#disabled = [ "keyboard", "folding" ]
let g:pandoc#filetypes#pandoc_markdown = 1 let g:pandoc#filetypes#pandoc_markdown = 1
let g:pandoc#filetypes#handled = [ "extra", "latex", "markdown", "pandoc", "rst", "textile" ] let g:pandoc#filetypes#handled = [ "extra", "latex", "markdown", "pandoc", "rst", "textile" ]
" disable all default keymaps " disable all default keymaps