Refactor/preset name true syntax (#4)
* refactor(config): replace array preset syntax with preset_name = true Problem: setup() mixed array entries (preset names) and hash entries (custom providers keyed by filetype), requiring verbose vim.tbl_deep_extend boilerplate to override presets. Solution: unify under a single key=value model. Keys are preset names or filetypes; true registers the preset as-is, a table deep-merges with the matching preset (or registers a custom provider if no preset matches), and false is a no-op. Array entries are dropped. Also adds -f gfm to presets.github args so pandoc parses input as GFM. * ci: format * fix(presets): parenthesize gsub output to suppress redundant-return-value * ci: remove superfluous things * refactor: remove PreviewWatch* events and clean up docs Problem: PreviewWatchStarted/PreviewWatchStopped were redundant with the status() API, and the doc had a wrong author, stale INSTALLATION format, and "watch mode" language left over from the watch → toggle rename. Solution: Remove the events and their tests. Fix the doc author, rename INSTALLATION → SETUP to match sibling plugins, replace "watch mode" with "auto-compile" throughout, and drop the events from EVENTS.
This commit is contained in:
parent
2d212aa220
commit
0b16ff7178
4 changed files with 8 additions and 82 deletions
|
|
@ -188,11 +188,6 @@ function M.toggle(bufnr, name, provider, ctx_builder)
|
|||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_exec_autocmds('User', {
|
||||
pattern = 'PreviewWatchStarted',
|
||||
data = { bufnr = bufnr, provider = name },
|
||||
})
|
||||
|
||||
M.compile(bufnr, name, provider, ctx_builder(bufnr))
|
||||
end
|
||||
|
||||
|
|
@ -205,11 +200,6 @@ function M.unwatch(bufnr)
|
|||
vim.api.nvim_del_autocmd(au_id)
|
||||
watching[bufnr] = nil
|
||||
log.dbg('unwatched buffer %d', bufnr)
|
||||
|
||||
vim.api.nvim_exec_autocmds('User', {
|
||||
pattern = 'PreviewWatchStopped',
|
||||
data = { bufnr = bufnr },
|
||||
})
|
||||
end
|
||||
|
||||
---@param bufnr integer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue