From ad25404f6f06f143b13daae009e2dbc92ae1cc83 Mon Sep 17 00:00:00 2001 From: Igor Date: Wed, 6 Dec 2023 20:33:49 -0300 Subject: [PATCH 01/10] refactor(dap)!: split dap and dap_ui This Pull Request makes 3 changes to the nvim-dap integration: 1. Splits the dap and dap_ui integrations. Rationale: there's no need for both plugins to share a integration. In fact, that's the only integration that contains multiple plugins. 2. Adds a missing highlight group to the nvim-dap integration 3. Removes a misguided comment about enabling the nvim-dap integration --- README.md | 24 ++++++++---- lua/catppuccin/groups/integrations/dap.lua | 33 +---------------- lua/catppuccin/groups/integrations/dap_ui.lua | 37 +++++++++++++++++++ 3 files changed, 54 insertions(+), 40 deletions(-) create mode 100644 lua/catppuccin/groups/integrations/dap_ui.lua diff --git a/README.md b/README.md index 8bb95167..729ef568 100644 --- a/README.md +++ b/README.md @@ -938,22 +938,16 @@ cmp = true - nvim-dap & nvim-dap-ui + nvim-dap ```lua -dap = { - enabled = true, - enable_ui = true, -- enable nvim-dap-ui -} +dap = true ```
Special ```lua --- You NEED to override nvim-dap's default highlight groups, AFTER requiring nvim-dap -require("dap") - local sign = vim.fn.sign_define sign("DapBreakpoint", { text = "●", texthl = "DapBreakpoint", linehl = "", numhl = ""}) @@ -967,6 +961,20 @@ sign("DapLogPoint", { text = "◆", texthl = "DapLogPoint", linehl = "", numhl = + + + + nvim-dap-ui + + +```lua +dap_ui = true, +``` + + + + + diff --git a/lua/catppuccin/groups/integrations/dap.lua b/lua/catppuccin/groups/integrations/dap.lua index cd3bc9ba..94c5f297 100644 --- a/lua/catppuccin/groups/integrations/dap.lua +++ b/lua/catppuccin/groups/integrations/dap.lua @@ -2,42 +2,11 @@ local M = {} function M.get() return { - -- nvim-dap DapBreakpoint = { fg = C.red }, DapBreakpointCondition = { fg = C.yellow }, + DapBreakpointRejected = { fg = C.mauve }, DapLogPoint = { fg = C.sky }, DapStopped = { fg = C.maroon }, - - -- nvim-dap-ui - DAPUIScope = { fg = C.sky }, - DAPUIType = { fg = C.mauve }, - DAPUIValue = { fg = C.sky }, - DAPUIVariable = { fg = C.text }, - DapUIModifiedValue = { fg = C.peach }, - DapUIDecoration = { fg = C.sky }, - DapUIThread = { fg = C.green }, - DapUIStoppedThread = { fg = C.sky }, - DapUISource = { fg = C.lavender }, - DapUILineNumber = { fg = C.sky }, - DapUIFloatBorder = { fg = C.sky }, - - DapUIWatchesEmpty = { fg = C.maroon }, - DapUIWatchesValue = { fg = C.green }, - DapUIWatchesError = { fg = C.maroon }, - - DapUIBreakpointsPath = { fg = C.sky }, - DapUIBreakpointsInfo = { fg = C.green }, - DapUIBreakpointsCurrentLine = { fg = C.green, style = { "bold" } }, - DapUIBreakpointsDisabledLine = { fg = C.surface2 }, - - DapUIStepOver = { fg = C.blue }, - DapUIStepInto = { fg = C.blue }, - DapUIStepBack = { fg = C.blue }, - DapUIStepOut = { fg = C.blue }, - DapUIStop = { fg = C.red }, - DapUIPlayPause = { fg = C.green }, - DapUIRestart = { fg = C.green }, - DapUIUnavailable = { fg = C.surface1 }, } end diff --git a/lua/catppuccin/groups/integrations/dap_ui.lua b/lua/catppuccin/groups/integrations/dap_ui.lua new file mode 100644 index 00000000..55e45c9a --- /dev/null +++ b/lua/catppuccin/groups/integrations/dap_ui.lua @@ -0,0 +1,37 @@ +local M = {} + +function M.get() + return { + DAPUIScope = { fg = C.sky }, + DAPUIType = { fg = C.mauve }, + DAPUIValue = { fg = C.sky }, + DAPUIVariable = { fg = C.text }, + DapUIModifiedValue = { fg = C.peach }, + DapUIDecoration = { fg = C.sky }, + DapUIThread = { fg = C.green }, + DapUIStoppedThread = { fg = C.sky }, + DapUISource = { fg = C.lavender }, + DapUILineNumber = { fg = C.sky }, + DapUIFloatBorder = { fg = C.sky }, + + DapUIWatchesEmpty = { fg = C.maroon }, + DapUIWatchesValue = { fg = C.green }, + DapUIWatchesError = { fg = C.maroon }, + + DapUIBreakpointsPath = { fg = C.sky }, + DapUIBreakpointsInfo = { fg = C.green }, + DapUIBreakpointsCurrentLine = { fg = C.green, style = { "bold" } }, + DapUIBreakpointsDisabledLine = { fg = C.surface2 }, + + DapUIStepOver = { fg = C.blue }, + DapUIStepInto = { fg = C.blue }, + DapUIStepBack = { fg = C.blue }, + DapUIStepOut = { fg = C.blue }, + DapUIStop = { fg = C.red }, + DapUIPlayPause = { fg = C.green }, + DapUIRestart = { fg = C.green }, + DapUIUnavailable = { fg = C.surface1 }, + } +end + +return M From ca791619cd88152cbec1d62d032744b70522827d Mon Sep 17 00:00:00 2001 From: Igor Date: Wed, 6 Dec 2023 21:08:52 -0300 Subject: [PATCH 02/10] fixup! refactor(dap)!: split dap and dap_ui --- doc/catppuccin.txt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/doc/catppuccin.txt b/doc/catppuccin.txt index 7c520df1..d048da1c 100644 --- a/doc/catppuccin.txt +++ b/doc/catppuccin.txt @@ -617,19 +617,13 @@ nvim-cmp>lua cmp = true < -nvim-dap & nvim-dap-ui>lua - dap = { - enabled = true, - enable_ui = true, -- enable nvim-dap-ui - } +nvim-dap>lua + dap = true < Special ~ >lua - -- You NEED to override nvim-dap's default highlight groups, AFTER requiring nvim-dap - require("dap") - local sign = vim.fn.sign_define sign("DapBreakpoint", { text = "●", texthl = "DapBreakpoint", linehl = "", numhl = ""}) @@ -637,6 +631,10 @@ Special ~ sign("DapLogPoint", { text = "◆", texthl = "DapLogPoint", linehl = "", numhl = ""}) < +nvim-dap-ui>lua + dap_ui = true +< + nvim-lspconfig>lua native_lsp = { enabled = true, From b4f3b33c7a7f4d682dd6454c07b922a30df3beab Mon Sep 17 00:00:00 2001 From: mrtnvgr Date: Thu, 7 Dec 2023 12:58:36 +0700 Subject: [PATCH 03/10] chore: update selene types --- vim.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vim.yml b/vim.yml index fb656ab5..48288be1 100644 --- a/vim.yml +++ b/vim.yml @@ -251,10 +251,10 @@ globals: type: bool property: read-only - O.integrations.dap.enabled: + O.integrations.dap: type: bool property: read-only - O.integrations.dap.enable_ui: + O.integrations.dap_ui: type: bool property: read-only From c7e4f049543bf33de5693cb1b4330912a8c1de46 Mon Sep 17 00:00:00 2001 From: mrtnvgr Date: Thu, 7 Dec 2023 13:01:11 +0700 Subject: [PATCH 04/10] chore: update lua types --- lua/catppuccin/types.lua | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lua/catppuccin/types.lua b/lua/catppuccin/types.lua index 7cbe916e..534cebe1 100644 --- a/lua/catppuccin/types.lua +++ b/lua/catppuccin/types.lua @@ -118,18 +118,15 @@ -- `coc.nvim` links to `native_lsp` highlight groups, so you can use -- `native_lsp.virtual_text` and `native_lsp.underlines` to style diagnostics. ---@field coc_nvim boolean? --- You **NEED** to override nvim-dap's default highlight groups, **AFTER** requiring nvim-dap: --- -- ```lua --- require("dap") --- -- local sign = vim.fn.sign_define -- -- sign("DapBreakpoint", { text = "●", texthl = "DapBreakpoint", linehl = "", numhl = ""}) -- sign("DapBreakpointCondition", { text = "●", texthl = "DapBreakpointCondition", linehl = "", numhl = ""}) -- sign("DapLogPoint", { text = "◆", texthl = "DapLogPoint", linehl = "", numhl = ""}) -- ``` ----@field dap CtpIntegrationDAP | boolean? +---@field dap boolean? +---@field dap_ui boolean? ---@field dashboard boolean? ---@field dropbar CtpIntegrationDropbar | boolean? ---@field fern boolean? @@ -209,11 +206,6 @@ -- Whether the directory name should be dimmed. ---@field dim_dirname boolean? ----@class CtpIntegrationDAP ----@field enabled boolean --- Enable `nvim-dap-ui` ----@field enable_ui boolean? - ---@class CtpIntegrationDropbar -- Whether to enable the dropbar integration. ---@field enabled boolean From 0c3e5f69a7f7d9028f4ca727dc4eab515a72992b Mon Sep 17 00:00:00 2001 From: mrtnvgr Date: Fri, 8 Dec 2023 12:31:09 +0700 Subject: [PATCH 05/10] fix: `DAP*` -> `Dap*` --- lua/catppuccin/groups/integrations/dap_ui.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/catppuccin/groups/integrations/dap_ui.lua b/lua/catppuccin/groups/integrations/dap_ui.lua index 55e45c9a..415431b9 100644 --- a/lua/catppuccin/groups/integrations/dap_ui.lua +++ b/lua/catppuccin/groups/integrations/dap_ui.lua @@ -2,10 +2,10 @@ local M = {} function M.get() return { - DAPUIScope = { fg = C.sky }, - DAPUIType = { fg = C.mauve }, - DAPUIValue = { fg = C.sky }, - DAPUIVariable = { fg = C.text }, + DapUIScope = { fg = C.sky }, + DapUIType = { fg = C.mauve }, + DapUIValue = { fg = C.sky }, + DapUIVariable = { fg = C.text }, DapUIModifiedValue = { fg = C.peach }, DapUIDecoration = { fg = C.sky }, DapUIThread = { fg = C.green }, From a214bbc0573a15037e92306e611b6efbe4f48f5c Mon Sep 17 00:00:00 2001 From: mrtnvgr Date: Fri, 8 Dec 2023 12:31:37 +0700 Subject: [PATCH 06/10] feat: `DapUIWinSelect` group --- lua/catppuccin/groups/integrations/dap_ui.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/catppuccin/groups/integrations/dap_ui.lua b/lua/catppuccin/groups/integrations/dap_ui.lua index 415431b9..88643e96 100644 --- a/lua/catppuccin/groups/integrations/dap_ui.lua +++ b/lua/catppuccin/groups/integrations/dap_ui.lua @@ -31,6 +31,8 @@ function M.get() DapUIPlayPause = { fg = C.green }, DapUIRestart = { fg = C.green }, DapUIUnavailable = { fg = C.surface1 }, + + DapUIWinSelect = { fg = C.peach }, } end From 39565ed61c1a29152c10015942fb31242b300f2d Mon Sep 17 00:00:00 2001 From: mrtnvgr Date: Fri, 8 Dec 2023 12:33:02 +0700 Subject: [PATCH 07/10] feat: make changes backwards compatible --- lua/catppuccin/groups/integrations/dap_ui.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/catppuccin/groups/integrations/dap_ui.lua b/lua/catppuccin/groups/integrations/dap_ui.lua index 88643e96..2b99c411 100644 --- a/lua/catppuccin/groups/integrations/dap_ui.lua +++ b/lua/catppuccin/groups/integrations/dap_ui.lua @@ -1,6 +1,10 @@ local M = {} function M.get() + if O.integrations.dap.enabled and O.integrations.dap.enable_ui ~= nil then + O.integrations.dap_ui = O.integrations.dap.enable_ui + end + return { DapUIScope = { fg = C.sky }, DapUIType = { fg = C.mauve }, From f923efaea1a77c71e68bde42941e300f695774c4 Mon Sep 17 00:00:00 2001 From: mrtnvgr Date: Fri, 8 Dec 2023 12:34:52 +0700 Subject: [PATCH 08/10] fix ci --- lua/catppuccin/groups/integrations/dap_ui.lua | 2 +- vim.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/catppuccin/groups/integrations/dap_ui.lua b/lua/catppuccin/groups/integrations/dap_ui.lua index 2b99c411..d4cd700c 100644 --- a/lua/catppuccin/groups/integrations/dap_ui.lua +++ b/lua/catppuccin/groups/integrations/dap_ui.lua @@ -2,7 +2,7 @@ local M = {} function M.get() if O.integrations.dap.enabled and O.integrations.dap.enable_ui ~= nil then - O.integrations.dap_ui = O.integrations.dap.enable_ui + O.integrations.dap_ui = O.integrations.dap.enable_ui end return { diff --git a/vim.yml b/vim.yml index 48288be1..ef095e3c 100644 --- a/vim.yml +++ b/vim.yml @@ -256,7 +256,7 @@ globals: property: read-only O.integrations.dap_ui: type: bool - property: read-only + property: full-write O.integrations.dashboard: type: bool From 16331da526068c13d8517010653ccd965ce72640 Mon Sep 17 00:00:00 2001 From: mrtnvgr Date: Fri, 8 Dec 2023 12:48:39 +0700 Subject: [PATCH 09/10] fix: move bc to appropriate place --- lua/catppuccin/groups/integrations/dap_ui.lua | 4 ---- lua/catppuccin/lib/mapper.lua | 7 +++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lua/catppuccin/groups/integrations/dap_ui.lua b/lua/catppuccin/groups/integrations/dap_ui.lua index d4cd700c..88643e96 100644 --- a/lua/catppuccin/groups/integrations/dap_ui.lua +++ b/lua/catppuccin/groups/integrations/dap_ui.lua @@ -1,10 +1,6 @@ local M = {} function M.get() - if O.integrations.dap.enabled and O.integrations.dap.enable_ui ~= nil then - O.integrations.dap_ui = O.integrations.dap.enable_ui - end - return { DapUIScope = { fg = C.sky }, DapUIType = { fg = C.mauve }, diff --git a/lua/catppuccin/lib/mapper.lua b/lua/catppuccin/lib/mapper.lua index 285de9b8..e5087b21 100644 --- a/lua/catppuccin/lib/mapper.lua +++ b/lua/catppuccin/lib/mapper.lua @@ -26,6 +26,12 @@ function M.apply(flavour) theme.editor = require("catppuccin.groups.editor").get() local final_integrations = {} + -- https://github.com/catppuccin/nvim/pull/624 + if type(O.integrations.dap) == "table" and O.integrations.dap.enable_ui ~= nil then + O.integrations.dap_ui = O.integrations.dap.enable_ui + O.integrations.dap.enable_ui = nil + end + for integration in pairs(O.integrations) do local cot = false if type(O.integrations[integration]) == "table" then @@ -46,6 +52,7 @@ function M.apply(flavour) ) end end + theme.integrations = final_integrations -- plugins theme.terminal = require("catppuccin.groups.terminal").get() -- terminal colors local user_highlights = O.highlight_overrides From 311af497a1e3c82c1e1ddc156c96d1a0cc9a34c8 Mon Sep 17 00:00:00 2001 From: Null Chilly Date: Fri, 8 Dec 2023 13:32:48 +0700 Subject: [PATCH 10/10] docs: fix trailing comma --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 729ef568..3ba7c358 100644 --- a/README.md +++ b/README.md @@ -968,7 +968,7 @@ sign("DapLogPoint", { text = "◆", texthl = "DapLogPoint", linehl = "", numhl = ```lua -dap_ui = true, +dap_ui = true ```