diff --git a/doc/nvim-dap-ui.txt b/doc/nvim-dap-ui.txt index cb5f903..b9e2c65 100644 --- a/doc/nvim-dap-ui.txt +++ b/doc/nvim-dap-ui.txt @@ -1,5 +1,5 @@ ================================================================================ - *nvim-dap-ui* +NVIM-DAP-UI *nvim-dap-ui* dapui.float_element({elem_name}, {settings}) *dapui.float_element()* Open a floating window containing the desired element. @@ -42,6 +42,15 @@ dapui.eval({expr}, {settings}) *dapui.eval()* {enter} (boolean) Whether or not to enter the window after opening +dapui.update_render({update}) *dapui.update_render()* + Update the config.render settings and re-render windows + + + Parameters: ~ + {update} (table) Updated settings, from the `render` table of the + config + + dapui.close({opts}) *dapui.close()* Close one or all of the window layouts diff --git a/lua/dapui/config/init.lua b/lua/dapui/config/init.lua index fb936ff..182701c 100644 --- a/lua/dapui/config/init.lua +++ b/lua/dapui/config/init.lua @@ -215,6 +215,10 @@ function M.render() return user_config.render end +function M.update_render(update) + user_config.render = vim.tbl_deep_extend("keep", update, user_config.render) +end + function M.expand_lines() return user_config.expand_lines end diff --git a/lua/dapui/init.lua b/lua/dapui/init.lua index 9772618..7bb8632 100644 --- a/lua/dapui/init.lua +++ b/lua/dapui/init.lua @@ -222,6 +222,14 @@ function dapui.setup(user_config) end) end +---Update the config.render settings and re-render windows +---@param update table: Updated settings, from the `render` table of the config +function dapui.update_render(update) + config.update_render(update) + local render = require("dapui.render") + render.loop.run() +end + local function keep_cmdheight(cb) local cmd_height = vim.o.cmdheight diff --git a/lua/dapui/util.lua b/lua/dapui/util.lua index bb67d86..1bf9a4f 100644 --- a/lua/dapui/util.lua +++ b/lua/dapui/util.lua @@ -201,7 +201,7 @@ function M.render_type(maybe_type) return "" end local max_length = config.render().max_type_length - if not max_length then + if not max_length or max_length == -1 then return maybe_type end if max_length == 0 then