refactor: rename compile/toggle commands to build/watch
Problem: `compile` and `toggle` are accurate but unintuitive — `compile` sounds academic and `toggle` says nothing about what it toggles. Solution: rename the public API and `:Preview` subcommands to `build` (one-shot) and `watch` (live preview). Internal compiler functions are unchanged. No aliases for old names — clean break.
This commit is contained in:
parent
8c7bc61286
commit
3a36264f18
3 changed files with 13 additions and 13 deletions
|
|
@ -39,10 +39,10 @@
|
|||
|
||||
---@class preview
|
||||
---@field setup fun(opts?: table)
|
||||
---@field compile fun(bufnr?: integer)
|
||||
---@field build fun(bufnr?: integer)
|
||||
---@field stop fun(bufnr?: integer)
|
||||
---@field clean fun(bufnr?: integer)
|
||||
---@field toggle fun(bufnr?: integer)
|
||||
---@field watch fun(bufnr?: integer)
|
||||
---@field open fun(bufnr?: integer)
|
||||
---@field status fun(bufnr?: integer): preview.Status
|
||||
---@field statusline fun(bufnr?: integer): string
|
||||
|
|
@ -144,7 +144,7 @@ function M.build_context(bufnr)
|
|||
end
|
||||
|
||||
---@param bufnr? integer
|
||||
function M.compile(bufnr)
|
||||
function M.build(bufnr)
|
||||
bufnr = bufnr or vim.api.nvim_get_current_buf()
|
||||
local name = M.resolve_provider(bufnr)
|
||||
if not name then
|
||||
|
|
@ -176,7 +176,7 @@ function M.clean(bufnr)
|
|||
end
|
||||
|
||||
---@param bufnr? integer
|
||||
function M.toggle(bufnr)
|
||||
function M.watch(bufnr)
|
||||
bufnr = bufnr or vim.api.nvim_get_current_buf()
|
||||
local name = M.resolve_provider(bufnr)
|
||||
if not name then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue