Skip to content

Commit

Permalink
fix: Fix normalize windows path, fix #22
Browse files Browse the repository at this point in the history
  • Loading branch information
weirongxu committed Mar 20, 2020
1 parent 994689a commit 0bbd9d6
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions autoload/plantuml_previewer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ function! s:run_in_background(cmd) "{{{
endif
endfunction "}}}

function! s:normalize_path(path) "{{{
return simplify(expand(a:path))
endfunction "}}}

function! plantuml_previewer#refresh(bufnr) "{{{
let puml_src_path = fnamemodify(bufname(a:bufnr), ':p')
let puml_filename = fnamemodify(puml_src_path, ':t:r')
Expand All @@ -133,12 +137,12 @@ function! plantuml_previewer#refresh(bufnr) "{{{
\ s:update_viewer_script_path,
\ s:jar_path(),
\ puml_src_path,
\ output_dir_path,
\ output_path,
\ finial_path,
\ s:normalize_path(output_dir_path),
\ s:normalize_path(output_path),
\ s:normalize_path(finial_path),
\ image_type,
\ localtime(),
\ s:viewer_tmp_js_path(),
\ s:normalize_path(s:viewer_tmp_js_path()),
\ ]
call s:run_in_background(cmd)
endfunction "}}}
Expand Down Expand Up @@ -172,9 +176,9 @@ function! plantuml_previewer#save_as(...) "{{{
\ s:save_as_script_path,
\ s:jar_path(),
\ puml_src_path,
\ output_dir_path,
\ output_path,
\ save_path,
\ s:normalize_path(output_dir_path),
\ s:normalize_path(output_path),
\ s:normalize_path(save_path),
\ image_type,
\ ]
call s:run_in_background(cmd)
Expand Down

0 comments on commit 0bbd9d6

Please sign in to comment.