From dc960908f2a9be9bcb970c2da9c433150a2b5361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3n=C3=A1n=20Carrigan?= Date: Tue, 7 Feb 2023 08:58:22 +0000 Subject: [PATCH] feat(controls): disconnect See #225 --- doc/nvim-dap-ui.txt | 5 +++-- lua/dapui/config/init.lua | 1 + lua/dapui/elements/repl.lua | 1 + lua/dapui/init.lua | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/nvim-dap-ui.txt b/doc/nvim-dap-ui.txt index 01cc187..226bbb5 100644 --- a/doc/nvim-dap-ui.txt +++ b/doc/nvim-dap-ui.txt @@ -57,6 +57,7 @@ Default values: element = "repl", enabled = true, icons = { + disconnect = "", pause = "", play = "", run_last = "", @@ -166,7 +167,7 @@ Open a floating window containing the result of evaluting an expression If no fixed dimensions are given, the window will expand to fit the contents of the buffer. Parameters~ -{expr} `(string)` Expression to evaluate. If nil, then in normal more the +{expr?} `(string)` Expression to evaluate. If nil, then in normal more the current word is used, and in visual mode the currently highlighted text. {args} `(dapui.EvalArgs)` @@ -375,7 +376,7 @@ Mappings: Add a new watch expression Parameters~ -{expr} `(string)` +{expr?} `(string)` *dapui.elements.watches.edit()* `edit`({index}, {new_expr}) diff --git a/lua/dapui/config/init.lua b/lua/dapui/config/init.lua index 804e724..bc3ddaa 100644 --- a/lua/dapui/config/init.lua +++ b/lua/dapui/config/init.lua @@ -131,6 +131,7 @@ local default_config = { step_back = "", run_last = "", terminate = "", + disconnect = "", }, }, render = { diff --git a/lua/dapui/elements/repl.lua b/lua/dapui/elements/repl.lua index f718b1c..9abfb93 100644 --- a/lua/dapui/elements/repl.lua +++ b/lua/dapui/elements/repl.lua @@ -10,6 +10,7 @@ return function() --- The REPL provided by nvim-dap. dapui.elements.repl = {} + ---@nodoc local function get_buffer() -- TODO: All of this is a hack because of an error with indentline when buffer -- is opened in a window so have to manually find the window that was opened. diff --git a/lua/dapui/init.lua b/lua/dapui/init.lua index a2882cb..fc423f1 100644 --- a/lua/dapui/init.lua +++ b/lua/dapui/init.lua @@ -504,6 +504,7 @@ function dapui.controls(is_active) { func = "step_back", hl = avail_hl(is_active and "DapUIStepBack" or "DapUIStepBackNC") }, { func = "run_last", hl = is_active and "DapUIRestart" or "DapUIRestartNC" }, { func = "terminate", hl = avail_hl(is_active and "DapUIStop" or "DapUIStopNC", true) }, + { func = "disconnect", hl = avail_hl(is_active and "DapUIStop" or "DapUIStopNC", true) }, } local bar = "" for _, elem in ipairs(elems) do