fix: move breakpoint keys to <leader> prefix to avoid clobbering x/X/D
This commit is contained in:
4 files changed
+23
-15
No files matched your search
@@ -14,7 +14,7 @@ That's it. No other config needed. See `:help tiny-debugger` for customization.
|
||||
|
||||
## Usage
|
||||
|
||||
`<leader>d` toggles debug mode. `x` sets breakpoints (works anytime).
|
||||
`<leader>d` toggles debug mode. `<leader>x` sets breakpoints (works anytime).
|
||||
|
||||
During debug mode, single-key controls:
|
||||
|
||||
@@ -25,10 +25,17 @@ During debug mode, single-key controls:
|
||||
| `d` | Step into | `E` | Eval in REPL |
|
||||
| `r` | Step out | `q` | Terminate session |
|
||||
| `C` | Run to cursor | `R` | Restart session |
|
||||
| `x` | Toggle breakpoint | `D` | Clear all breakpoints |
|
||||
| `X` | Conditional breakpoint | `?` | Help popup |
|
||||
| `?` | Help popup | | |
|
||||
|
||||
All navigation keys preserved. Keybindings vanish when you exit debug mode.
|
||||
Always available (no debug mode needed):
|
||||
|
||||
| Key | Action |
|
||||
|-----|------------------------|
|
||||
| `<leader>x` | Toggle breakpoint |
|
||||
| `<leader>X` | Conditional breakpoint |
|
||||
| `<leader>D` | Clear all breakpoints |
|
||||
|
||||
All navigation keys preserved. Modal keybindings vanish when you exit debug mode.
|
||||
|
||||
## Supported Languages
|
||||
|
||||
|
||||
@@ -99,9 +99,6 @@ Default keymap:
|
||||
`d` Step into Descend into the function
|
||||
`r` Step out Return from the function
|
||||
`C` Run to cursor Continue to cursor
|
||||
`x` Toggle breakpoint X marks the spot (always active)
|
||||
`X` Conditional breakpoint Shift variant of x (always active)
|
||||
`D` Clear all breakpoints Delete all (always active)
|
||||
`W` Watch expr under cursor Watch
|
||||
`K` Hover / inspect Matches LSP hover convention
|
||||
`E` Eval in REPL Evaluate
|
||||
@@ -109,7 +106,11 @@ Default keymap:
|
||||
`R` Restart session Rerun
|
||||
`?` Help popup Show keybindings
|
||||
|
||||
Note: `x`, `X`, and `D` work outside debug mode too (persistent breakpoints).
|
||||
Always available (not part of debug mode):
|
||||
|
||||
`<leader>x` Toggle breakpoint X marks the spot
|
||||
`<leader>X` Conditional breakpoint Shift variant
|
||||
`<leader>D` Clear all breakpoints Delete all
|
||||
|
||||
Override any key: >lua
|
||||
require("tiny-debugger").setup({
|
||||
|
||||
@@ -10,14 +10,14 @@ M.defaults = {
|
||||
step_into = "d",
|
||||
step_out = "r",
|
||||
run_to_cursor = "C",
|
||||
breakpoint = "x",
|
||||
cond_breakpoint = "X",
|
||||
breakpoint = "<leader>x",
|
||||
cond_breakpoint = "<leader>X",
|
||||
watch = "W",
|
||||
hover = "K",
|
||||
eval = "E",
|
||||
terminate = "q",
|
||||
restart = "R",
|
||||
clear_breakpoints = "D",
|
||||
clear_breakpoints = "<leader>D",
|
||||
help = "?",
|
||||
},
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ local assert_eq = require("helpers").assert_eq
|
||||
local td = require("tiny-debugger")
|
||||
td.setup()
|
||||
|
||||
-- global x mapping exists
|
||||
assert_eq(vim.fn.maparg("x", "n", false, true).desc, "tiny-debugger: toggle breakpoint", "global x mapping")
|
||||
-- global <leader>x mapping exists
|
||||
assert_eq(vim.fn.maparg("<leader>x", "n", false, true).desc, "tiny-debugger: toggle breakpoint", "global <leader>x mapping")
|
||||
|
||||
-- global X mapping exists
|
||||
assert_eq(vim.fn.maparg("X", "n", false, true).desc, "tiny-debugger: conditional breakpoint", "global X mapping")
|
||||
-- global <leader>X mapping exists
|
||||
assert_eq(vim.fn.maparg("<leader>X", "n", false, true).desc, "tiny-debugger: conditional breakpoint", "global <leader>X mapping")
|
||||
|
||||
-- persistent-breakpoints API is callable
|
||||
local api = require("persistent-breakpoints.api")
|
||||
|
||||
Reference in new issue
Block a user