From f1154553d11f244bad928f9e24f86fe6b342db8a Mon Sep 17 00:00:00 2001 From: name Date: Fri, 18 Oct 2024 12:52:43 +0900 Subject: [PATCH] feat: Set breakpoint icons and their highlight colors --- lua/kickstart/plugins/debug.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 196f2c6d..2067ce3a 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -89,6 +89,19 @@ return { }, } + -- Change breakpoint icons + -- For more information, see https://github.com/mfussenegger/nvim-dap/discussions/355 + vim.api.nvim_set_hl(0, 'Break', { fg = '#e51400' }) + vim.api.nvim_set_hl(0, 'Stop', { fg = '#ffcc00' }) + local breakpoint_icons = vim.g.have_nerd_font + and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' } + or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' } + for type, icon in pairs(breakpoint_icons) do + local tp = 'Dap' .. type + local hl = (type == 'Stopped') and 'Stop' or 'Break' + vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl }) + end + dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close