aklt/plantuml-syntax

:make fails when the file name contains spaces

tantignac opened this issue · 3 comments

Hello,

On MacOS X, with a file name containing a space, the script seems not to work.

:make returns:

:!java -jar /Applications/plantuml.jar file name.pu  2>&1| tee /var/folders/w8/4yl70ryj3y
73838z16_8m1r40000gn/T/vsAUb5d/1

instead of:

:!java -jar /Applications/plantuml.jar "file name.pu"  2>&1| tee /var/folders/w8/4yl70ryj3y
73838z16_8m1r40000gn/T/vsAUb5d/1

(or it could be file\ name.puas well).

I guess the quotes have to be added somewhere in the vim-script but I do not know how to do it.

It is ok if there is no space in the file name :)

aklt commented

Thanks, I'll add it when I have time!

I encounter the same issue. I got it working and will explain how in this comment:

In file https://github.com/aklt/plantuml-syntax/blob/master/ftplugin/plantuml.vim looking for the line https://github.com/aklt/plantuml-syntax/blob/master/ftplugin/plantuml.vim#L16 and insert the following code right before:

let s:path="/path/to/homefolder/"
let s:path=s:path.expand("%")
let s:path=fnameescape(s:path) 

and change line 16 to

let s:makecommand=g:plantuml_executable_script." ".s:path

In my .vimrc file I added the following line:

let g:plantuml_executable_script='java -jar /path/to/plantuml.jar -v'

Restart VIM and it should work.

aklt commented

Thanks for the fix :)