refactor: rename build to compile and watch to toggle in public API

Problem: the code used build/watch while the help file already
documented compile/toggle, creating a confusing mismatch.

Solution: rename M.build() to M.compile() and M.watch() to M.toggle()
in init.lua, update handler keys in commands.lua, and update the test
file to match.
This commit is contained in:
Barrett Ruth 2026-03-04 13:10:34 -05:00
parent 4732696a62
commit 7a7c407d97
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
3 changed files with 12 additions and 12 deletions

View file

@ -14,10 +14,10 @@ describe('commands', function()
end)
describe('dispatch', function()
it('does not error on :Preview with no provider', function()
it('does not error on :Preview compile with no provider', function()
require('preview.commands').setup()
assert.has_no.errors(function()
vim.cmd('Preview build')
vim.cmd('Preview compile')
end)
end)
@ -42,10 +42,10 @@ describe('commands', function()
end)
end)
it('does not error on :Preview watch with no provider', function()
it('does not error on :Preview toggle with no provider', function()
require('preview.commands').setup()
assert.has_no.errors(function()
vim.cmd('Preview watch')
vim.cmd('Preview toggle')
end)
end)
end)