fix(textobj): use correct config variable, raise log level
Problem: motion keymaps (]], [[, ]t, [t) were never set because `config.get().debug` referenced an undefined `config` variable, crashing _setup_buf_mappings before the motion loop. Debug logging also used vim.log.levels.DEBUG which is filtered by default. Solution: replace `config` with `cfg` (already in scope) and raise both debug notify calls from DEBUG to INFO.
This commit is contained in:
parent
4f31ae5f10
commit
22ca3184d8
2 changed files with 3 additions and 4 deletions
|
|
@ -140,13 +140,12 @@ function M._setup_buf_mappings(bufnr)
|
||||||
prev_task = textobj.prev_task,
|
prev_task = textobj.prev_task,
|
||||||
}
|
}
|
||||||
|
|
||||||
local dbg = config.get().debug
|
|
||||||
for name, fn in pairs(motions) do
|
for name, fn in pairs(motions) do
|
||||||
local key = km[name]
|
local key = km[name]
|
||||||
if dbg then
|
if cfg.debug then
|
||||||
vim.notify(
|
vim.notify(
|
||||||
('[pending] mapping motion %s → %s (buf=%d)'):format(name, key or 'nil', bufnr),
|
('[pending] mapping motion %s → %s (buf=%d)'):format(name, key or 'nil', bufnr),
|
||||||
vim.log.levels.DEBUG
|
vim.log.levels.INFO
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
if key and key ~= false then
|
if key and key ~= false then
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ local M = {}
|
||||||
---@return nil
|
---@return nil
|
||||||
local function dbg(...)
|
local function dbg(...)
|
||||||
if config.get().debug then
|
if config.get().debug then
|
||||||
vim.notify('[pending.textobj] ' .. string.format(...), vim.log.levels.DEBUG)
|
vim.notify('[pending.textobj] ' .. string.format(...), vim.log.levels.INFO)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue