From 79f7d5801c8e3fb682c4f5feeceae83f94bf69ef Mon Sep 17 00:00:00 2001 From: Mitchell Hingley Date: Thu, 8 Oct 2026 12:01:43 -0400 Subject: [PATCH] debugger fix, treesitter bindings, rosepine notify fix --- lua/config/lazy.lua | 3 +++ lua/plugins/debugger.lua | 25 ++++++++++++++++++++----- lua/plugins/nvim-treesitter.lua | 24 ++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 5 deletions(-) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 540fa26..7db2f35 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -45,6 +45,9 @@ require("lazy").setup({ }) vim.cmd("colorscheme " .. colScheme.name); vim.api.nvim_set_hl(0, "alphaheader", {fg = "#3661cf" }) +if (colScheme.name == "rose-pine") then + vim.api.nvim_set_hl(0, "NotifyBackground", { bg = "#232136" }) +end --setup colour indents local highlight = { diff --git a/lua/plugins/debugger.lua b/lua/plugins/debugger.lua index 2c404ca..58d1609 100644 --- a/lua/plugins/debugger.lua +++ b/lua/plugins/debugger.lua @@ -170,7 +170,10 @@ return { executable = { command = codelldb_path, args = {"--port", "${port}"}, - detached = false, + -- Keep the spawned server (and any inferior it launches) off + -- Neovim's console group so terminating a session can't take + -- Neovim down on Windows. Matches the cppvsdbg adapter above. + detached = true, } } @@ -187,14 +190,26 @@ return { }, } + -- Route MSVC `cppvsdbg` launch configs (as VS/msbuild launch.json + -- generates) to codelldb. We deliberately do NOT use Microsoft's vsdbg: + -- its license permits use only within Visual Studio / VS Code. codelldb + -- is LLVM/LLDB-based (Apache-2.0) and has a native PDB reader, so it can + -- debug MSVC/msbuild binaries without that restriction. + -- + -- codelldb is a TCP `server` adapter, so terminating/disconnecting + -- talks over a socket and can't broadcast a console CTRL event to + -- Neovim the way the gdb-backed cppdbg path does. detached=true keeps + -- the spawned server (and the inferior it launches) off Neovim's + -- console group too -- the original `detached = false` is what still + -- let a disconnect take Neovim down. dap.adapters.cppvsdbg = { - type = 'server', + type = "server", port = "${port}", executable = { command = codelldb_path, - args = {"--port", "${port}"}, - detached = false, - } + args = { "--port", "${port}" }, + detached = true, + }, } -- 3. Platform-agnostic Launcher Configuration diff --git a/lua/plugins/nvim-treesitter.lua b/lua/plugins/nvim-treesitter.lua index 89ea397..09d03ff 100644 --- a/lua/plugins/nvim-treesitter.lua +++ b/lua/plugins/nvim-treesitter.lua @@ -20,5 +20,29 @@ return { sync_install = false, highlight = { enable = true }, indent = { enable = true }, + + + -- Enable the textobjects extension + textobjects = { + move = { + enable = true, + set_jumps = true, -- Add jumps to the jumplist (:h jumplist) + + goto_next_start = { + ["]]"] = { query = "@function.outer", desc = "Next function definition start" }, + ["]c"] = { query = "@class.outer", desc = "Next class definition start" }, + }, + goto_previous_start = { + ["[["] = { query = "@function.outer", desc = "Previous function definition start" }, + ["[c"] = { query = "@class.outer", desc = "Previous class definition start" }, + }, + goto_next_end = { + ["]f"] = { query = "@function.outer", desc = "Next function definition end" }, + }, + goto_previous_end = { + ["[f"] = { query = "@function.outer", desc = "Previous function definition end" }, + }, + }, + }, }, }