fix(buffer): escape hyphens in infer_status Lua patterns (#119)

* fix(buffer): escape hyphens in `infer_status` Lua patterns

Problem: `infer_status` used `/-` in its Lua patterns, which is a lazy
quantifier on `/` rather than a literal hyphen. This caused the function
to always return `nil` for lines with an `/id/` prefix, so status was
never inferred from buffer text during `reapply_dirty_inline`.

Solution: escape hyphens as `%-` in both patterns. Also add debug
logging to `on_bytes`, `reapply_dirty_inline`, `apply_extmarks`, and
the `TextChanged`/`TextChangedI`/`InsertLeave` autocmds.

* ci: format
This commit is contained in:
Barrett Ruth 2026-03-09 00:31:13 -04:00 committed by GitHub
parent a38be10e67
commit 1eb2e49096
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 34 additions and 2 deletions

View file

@ -268,6 +268,7 @@ function M._setup_autocmds(bufnr)
if not vim.bo[bufnr].modified then
return
end
log.debug('autocmd: TextChangedI')
for row in pairs(buffer.dirty_rows()) do
buffer.clear_inline_row(bufnr, row)
end
@ -280,6 +281,7 @@ function M._setup_autocmds(bufnr)
if not vim.bo[bufnr].modified then
return
end
log.debug('autocmd: TextChanged')
buffer.reapply_dirty_inline(bufnr)
end,
})
@ -288,6 +290,7 @@ function M._setup_autocmds(bufnr)
buffer = bufnr,
callback = function()
if vim.bo[bufnr].modified then
log.debug('autocmd: InsertLeave')
buffer.reapply_dirty_inline(bufnr)
end
end,