Skip to content

msbuild.vim doesn't escape file names #42

Open
@coollambda

Description

@coollambda

So I opened up a Unity script in GVim 8.0 and got the following error

"Assets\Scripts\MapGenerator.cs" 156L, 3615C
Error detected while processing C:\Users\bulkycaf\.vim\plugged\vim-csharp\compiler\msbuild.vim:
line   33:
E518: Unknown option: Cave

which happens in the last line in the following code

execute 'CompilerSet makeprg=' . cs#get_net_compiler("msbuild") . "\\ " 
            \ . "/nologo\\ /clp:Verbosity=quiet\\ /property:GenerateFullPaths=true\\ "
            \ . s:build_file

so I echoed the s:build_file variable and it was .\Procedural Cave Generation - Tutorial.sln
and so I fixed it by escaping the file name with fnameescape Vim function

execute 'CompilerSet makeprg=' . cs#get_net_compiler("msbuild") . "\\ " 
            \ . "/nologo\\ /clp:Verbosity=quiet\\ /property:GenerateFullPaths=true\\ "
            \ . fnameescape(s:build_file)

and now it works fine!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions