-- if set, when we switch between buffers, it will not split more than once. It will switch to the existing buffer instead
vim.opt.switchbuf = 'useopen'

local goc = require('nvim-goc')
goc.setup({ verticalSplit = false })


vim.cmd [[
    augroup nvimgoc_keymaps
        autocmd!
        autocmd FileType go nnoremap <buffer><leader>c :lua require('nvim-goc').Coverage()<cr>
        autocmd FileType go nnoremap <buffer><leader>cc :lua require('nvim-goc').ClearCoverage()<cr>
        autocmd FileType go nnoremap <buffer><leader>cf :lua require('nvim-goc').CoverageFunc()<cr>
    augroup end
]]

-- default colors
vim.api.nvim_set_hl(0, 'GocNormal', {link='Comment'})
vim.api.nvim_set_hl(0, 'GocCovered', {ctermfg=2, bold=true})
vim.api.nvim_set_hl(0, 'GocUncovered', {ctermfg=1, bold=true})
