fix: build tags was missing space (#46)

* fix: build tags was missing space

* if run in floaterm, '\ ' may cause error

Thanks for the PR. I did some update please check if it works

Co-authored-by: Ales Brelih <ales.brelih@3fs.si>
Co-authored-by: rayx <rayx.cn@gmail.com>
pull/50/head
Aleš Brelih 3 years ago committed by GitHub
parent 28dc304cdb
commit cfeab3d398
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -363,6 +363,7 @@ require('go').setup({
dap_debug_keymap = true, -- set keymaps for debugger
dap_debug_gui = true, -- set to true to enable dap gui, highly recommand
dap_debug_vt = true, -- set to true to enable dap virtual text
build_tags = "tag1,tag2" -- set default build tags
})
```

@ -6,8 +6,12 @@ local ginkgo = require("go.ginkgo")
local function get_build_tags(args)
local tags = "-tags"
local space = [[\ ]]
if _GO_NVIM_CFG.run_in_floaterm then
space = ' '
end
if _GO_NVIM_CFG.build_tags ~= "" then
tags = tags .. _GO_NVIM_CFG.build_tags
tags = tags .. space .. _GO_NVIM_CFG.build_tags
end
for i, value in pairs(args) do
@ -25,7 +29,7 @@ local function get_build_tags(args)
tags = ''
end
return tags, args
return space .. tags .. space, args
end
M.get_build_tags = get_build_tags

Loading…
Cancel
Save