diff options
| author | srdusr <trevorgray@srdusr.com> | 2023-05-08 20:30:08 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2023-05-08 20:30:08 +0200 |
| commit | 831a9724c7c6da487fb44eed76cb0949e3e4d0c7 (patch) | |
| tree | d156fbec2a136bd4ca951297f3d722ab53536e03 | |
| parent | 7eca86494e75b6229913bed4fad3d4f31f044575 (diff) | |
| download | dotfiles-831a9724c7c6da487fb44eed76cb0949e3e4d0c7.tar.gz dotfiles-831a9724c7c6da487fb44eed76cb0949e3e4d0c7.zip | |
Add DAPMessages
| -rw-r--r-- | lua/plugins/heirline.lua | 118 |
1 files changed, 98 insertions, 20 deletions
diff --git a/lua/plugins/heirline.lua b/lua/plugins/heirline.lua index dc415d5..a23b5bb 100644 --- a/lua/plugins/heirline.lua +++ b/lua/plugins/heirline.lua @@ -337,26 +337,100 @@ local Git = { -- Debugger -- Display informations from nvim-dap! +-- Note that we add spaces separately, so that only the icon characters will be clickable local DAPMessages = { - -- display the dap messages only on the debugged file - condition = function() - local session = require("dap").session() - if session then - local filename = vim.api.nvim_buf_get_name(0) - if session.config then - local progname = session.config.program - return filename == progname - end - end - return false - end, - provider = function() - return " " .. require("dap").status() - end, - hl = { fg = utils.get_highlight("Debug").fg }, - -- Debugger on_click: step-over, step-into, next, previous, stop buttons - -- coming soon! + condition = function() + local session = require("dap").session() + return session ~= nil + end, + provider = function() + return " " .. require("dap").status() .. " " + end, + hl = "Debug", + { + provider = "", + on_click = { + callback = function() + require("dap").step_into() + end, + name = "heirline_dap_step_into", + }, + }, + { provider = " " }, + { + provider = "", + on_click = { + callback = function() + require("dap").step_out() + end, + name = "heirline_dap_step_out", + }, + }, + { provider = " " }, + { + provider = " ", + on_click = { + callback = function() + require("dap").step_over() + end, + name = "heirline_dap_step_over", + }, + }, + { provider = " " }, + { + provider = "ﰇ", + on_click = { + callback = function() + require("dap").run_last() + end, + name = "heirline_dap_run_last", + }, + }, + { provider = " " }, + { + provider = "", + on_click = { + callback = function() + require("dap").terminate() + require("dapui").close({}) + end, + name = "heirline_dap_close", + }, + }, + { provider = " " }, + -- icons: ﰇ } +--local DAPMessages = { +-- -- display the dap messages only on the debugged file +-- condition = function() +-- local session = require("dap").session() +-- if session then +-- local filename = vim.api.nvim_buf_get_name(0) +-- if session.config then +-- local progname = session.config.program +-- return filename == progname +-- end +-- end +-- return false +-- end, +-- provider = function() +-- return " " .. require("dap").status() +-- end, +-- hl = { fg = utils.get_highlight("Debug").fg }, +-- -- Debugger on_click: step-over, step-into, next, previous, stop buttons +-- -- coming soon! +--} +--local DAPMessages = { +-- condition = function() +-- local session = require("dap").session() +-- return session ~= nil +-- end, +-- provider = function() +-- return " " .. require("dap").status() +-- end, +-- hl = "Debug" +-- -- see Click-it! section for clickable actions +--} -- Tests -- This requires the great ultest. @@ -716,6 +790,8 @@ local SpecialStatusline = { { LeftSpace, hl = { bg = colors.nobg, force = true } }, { Space, hl = { bg = colors.nobg, force = true } }, { Align, hl = { bg = colors.nobg, force = true } }, + { DAPMessages, hl = { bg = colors.nobg, force = true } }, + { Align, hl = { bg = colors.nobg, force = true } }, { RightSpace, hl = { bg = colors.nobg, force = true } }, { Ruler, hl = { fg = utils.get_highlight("statusline").bg, force = true } }, } @@ -732,6 +808,8 @@ local TerminalStatusline = { { FileNameBlock, hl = { bg = colors.nobg, force = true } }, { Space, hl = { bg = colors.nobg, force = true } }, { Align, hl = { bg = colors.nobg, force = true } }, + { DAPMessages, hl = { bg = colors.nobg, force = true } }, + { Align, hl = { bg = colors.nobg, force = true } }, { RightSpace, hl = { bg = colors.nobg, force = true } }, { Ruler, hl = { fg = utils.get_highlight("statusline").bg, force = true } }, } @@ -863,8 +941,8 @@ local Center = { -- Hide the winbar for special buffers condition = function() return conditions.buffer_matches({ - buftype = { "nofile", "prompt", "help", "quickfix" }, - filetype = { "^git.*", "fugitive", "dashboard", }, + buftype = { "terminal", "nofile", "prompt", "help", "quickfix" }, + filetype = { "dap-ui", "NvimTree", "^git.*", "fugitive", "dashboard", }, }) end, init = function() |
