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
|
## 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:
|
During debug mode, single-key controls:
|
||||||
|
|
||||||
@@ -25,10 +25,17 @@ During debug mode, single-key controls:
|
|||||||
| `d` | Step into | `E` | Eval in REPL |
|
| `d` | Step into | `E` | Eval in REPL |
|
||||||
| `r` | Step out | `q` | Terminate session |
|
| `r` | Step out | `q` | Terminate session |
|
||||||
| `C` | Run to cursor | `R` | Restart session |
|
| `C` | Run to cursor | `R` | Restart session |
|
||||||
| `x` | Toggle breakpoint | `D` | Clear all breakpoints |
|
| `?` | Help popup | | |
|
||||||
| `X` | Conditional breakpoint | `?` | 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
|
## Supported Languages
|
||||||
|
|
||||||
|
|||||||
@@ -99,9 +99,6 @@ Default keymap:
|
|||||||
`d` Step into Descend into the function
|
`d` Step into Descend into the function
|
||||||
`r` Step out Return from the function
|
`r` Step out Return from the function
|
||||||
`C` Run to cursor Continue to cursor
|
`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
|
`W` Watch expr under cursor Watch
|
||||||
`K` Hover / inspect Matches LSP hover convention
|
`K` Hover / inspect Matches LSP hover convention
|
||||||
`E` Eval in REPL Evaluate
|
`E` Eval in REPL Evaluate
|
||||||
@@ -109,7 +106,11 @@ Default keymap:
|
|||||||
`R` Restart session Rerun
|
`R` Restart session Rerun
|
||||||
`?` Help popup Show keybindings
|
`?` 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
|
Override any key: >lua
|
||||||
require("tiny-debugger").setup({
|
require("tiny-debugger").setup({
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ M.defaults = {
|
|||||||
step_into = "d",
|
step_into = "d",
|
||||||
step_out = "r",
|
step_out = "r",
|
||||||
run_to_cursor = "C",
|
run_to_cursor = "C",
|
||||||
breakpoint = "x",
|
breakpoint = "<leader>x",
|
||||||
cond_breakpoint = "X",
|
cond_breakpoint = "<leader>X",
|
||||||
watch = "W",
|
watch = "W",
|
||||||
hover = "K",
|
hover = "K",
|
||||||
eval = "E",
|
eval = "E",
|
||||||
terminate = "q",
|
terminate = "q",
|
||||||
restart = "R",
|
restart = "R",
|
||||||
clear_breakpoints = "D",
|
clear_breakpoints = "<leader>D",
|
||||||
help = "?",
|
help = "?",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ local assert_eq = require("helpers").assert_eq
|
|||||||
local td = require("tiny-debugger")
|
local td = require("tiny-debugger")
|
||||||
td.setup()
|
td.setup()
|
||||||
|
|
||||||
-- global x mapping exists
|
-- global <leader>x mapping exists
|
||||||
assert_eq(vim.fn.maparg("x", "n", false, true).desc, "tiny-debugger: toggle breakpoint", "global x mapping")
|
assert_eq(vim.fn.maparg("<leader>x", "n", false, true).desc, "tiny-debugger: toggle breakpoint", "global <leader>x mapping")
|
||||||
|
|
||||||
-- global X mapping exists
|
-- global <leader>X mapping exists
|
||||||
assert_eq(vim.fn.maparg("X", "n", false, true).desc, "tiny-debugger: conditional breakpoint", "global X mapping")
|
assert_eq(vim.fn.maparg("<leader>X", "n", false, true).desc, "tiny-debugger: conditional breakpoint", "global <leader>X mapping")
|
||||||
|
|
||||||
-- persistent-breakpoints API is callable
|
-- persistent-breakpoints API is callable
|
||||||
local api = require("persistent-breakpoints.api")
|
local api = require("persistent-breakpoints.api")
|
||||||
|
|||||||
Reference in new issue
Block a user