diff --git a/README.md b/README.md index ccf156c..92687e9 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ That's it. No other config needed. See `:help tiny-debugger` for customization. ## Usage -`d` toggles debug mode. `x` sets breakpoints (works anytime). +`d` toggles debug mode. `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 | +|-----|------------------------| +| `x` | Toggle breakpoint | +| `X` | Conditional breakpoint | +| `D` | Clear all breakpoints | + +All navigation keys preserved. Modal keybindings vanish when you exit debug mode. ## Supported Languages diff --git a/doc/tiny-debugger.txt b/doc/tiny-debugger.txt index 4c981dd..fbadda8 100644 --- a/doc/tiny-debugger.txt +++ b/doc/tiny-debugger.txt @@ -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): + + `x` Toggle breakpoint X marks the spot + `X` Conditional breakpoint Shift variant + `D` Clear all breakpoints Delete all Override any key: >lua require("tiny-debugger").setup({ diff --git a/lua/tiny-debugger/config.lua b/lua/tiny-debugger/config.lua index ff89184..577557b 100644 --- a/lua/tiny-debugger/config.lua +++ b/lua/tiny-debugger/config.lua @@ -10,14 +10,14 @@ M.defaults = { step_into = "d", step_out = "r", run_to_cursor = "C", - breakpoint = "x", - cond_breakpoint = "X", + breakpoint = "x", + cond_breakpoint = "X", watch = "W", hover = "K", eval = "E", terminate = "q", restart = "R", - clear_breakpoints = "D", + clear_breakpoints = "D", help = "?", }, diff --git a/tests/test_breakpoints.lua b/tests/test_breakpoints.lua index 1c7fd5b..09c7c2a 100644 --- a/tests/test_breakpoints.lua +++ b/tests/test_breakpoints.lua @@ -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 x mapping exists +assert_eq(vim.fn.maparg("x", "n", false, true).desc, "tiny-debugger: toggle breakpoint", "global x mapping") --- global X mapping exists -assert_eq(vim.fn.maparg("X", "n", false, true).desc, "tiny-debugger: conditional breakpoint", "global X mapping") +-- global X mapping exists +assert_eq(vim.fn.maparg("X", "n", false, true).desc, "tiny-debugger: conditional breakpoint", "global X mapping") -- persistent-breakpoints API is callable local api = require("persistent-breakpoints.api")