Merge branch 'master' into nvim_0_7

pull/152/head
ray-x 2 years ago
commit 427e1eb5b2

@ -360,6 +360,8 @@ or simply put your cursor in a struct and do
| GoDebug -s | stop debug session and unmap debug keymap |
| GoDbgKeys | show debug keymaps in a floating window (guihua) |
| GoBreakToggle | GoDebug -b |
| GoDbgStop | Same as GoDebug -s |
| GoDbgContinue | Continue debug session |
| BreakCondition | conditional break |
Notes:
@ -573,6 +575,7 @@ require('go').setup({
dap_debug = true, -- set to false to disable dap
dap_debug_keymap = true, -- true: use keymap for debugger defined in go/dap.lua
-- false: do not use keymap in go/dap.lua. you must define your own.
-- windows: use visual studio keymap
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

@ -269,6 +269,12 @@ COMMANDS *go-nvim-commands*
:GoDbgKeys *:GoDbgKeys*
Display keymaps for debuger
:GoDbgStop *:GoDbgStop*
Stop debug session and unmap all keymaps, same as GoDebug -s
:GoDbgContinue *:GoDbgStop*
Continue debug session, keymap `c`
:GoCreateLaunch *:GoCreateLaunch*
Create alaunch.json
@ -338,6 +344,7 @@ You can setup go.nvim with following options:
dap_debug_gui = true,
dap_debug_keymap = true, -- true: use keymap for debugger defined in go/dap.lua
-- false: do not use keymap in go/dap.lua. you must define your own.
-- windows: use visual studio style of keymap
dap_vt = true, -- false, true and 'all frames'
textobjects = true,
gopls_cmd = nil, --- you can provide gopls path and cmd if it not in PATH, e.g. cmd = { "/home/ray/.local/nvim/data/lspinstall/go/gopls" }

@ -229,7 +229,8 @@ function go.setup(cfg)
vim.cmd([[command! DapUiFloat lua require("dapui").float_element()]])
vim.cmd([[command! DapUiToggle lua require("dapui").toggle()]])
vim.cmd([[command! GoDbgStop lua require'go.dap'.stop()]])
vim.cmd([[command! GoDbgStop lua require'go.dap'.stop(true)]])
vim.cmd([[command! GoDbgContinue lua require'dap'.continue()]])
end
require("go.project").load_project()

@ -141,6 +141,7 @@ function M.debug_keys()
})
end
local close_events = { "CursorMoved", "CursorMovedI", "BufHidden", "InsertCharPre" }
local config = { close_events = close_events, focusable = true, border = "single" }
vim.lsp.util.open_floating_preview(keymap_help, "lua", config)

@ -48,10 +48,16 @@ local term = function(opts)
if opts.autoclose == nil then
opts.autoclose = true
end
-- run in neovim shell
if type(opts.cmd) == "table" then
opts.cmd = table.concat(opts.cmd, " ")
end
utils.log(opts)
local buf, win, closer = guihua_term.floating_term(opts)
api.nvim_command("setlocal nobuflisted")
api.nvim_buf_set_var(cur_buf, "go_float_terminal_win", { buf, win })
api.nvim_buf_set_var(cur_buf, "shellcmdflag", "shell-unquoting")
return buf, win, closer
end

Loading…
Cancel
Save