feat(compiler): notify on toggle watch start and stop (#13)

Problem: :Preview toggle gave no feedback, leaving the user to guess
whether watching was enabled or disabled.

Solution: emit vim.notify messages when toggling on ("watching with
\"<provider>\"") and off ("watching stopped"). Also normalize the
[preview.nvim] prefix in commands.lua to include the colon.
This commit is contained in:
Barrett Ruth 2026-03-03 14:18:28 -05:00 committed by GitHub
parent 0f353446b6
commit 7995d6422d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -27,9 +27,9 @@ local function dispatch(args)
if s.watching then
table.insert(parts, 'watching')
end
vim.notify('[preview.nvim] ' .. table.concat(parts, ', '), vim.log.levels.INFO)
vim.notify('[preview.nvim]: ' .. table.concat(parts, ', '), vim.log.levels.INFO)
else
vim.notify('[preview.nvim] unknown subcommand: ' .. subcmd, vim.log.levels.ERROR)
vim.notify('[preview.nvim]: unknown subcommand: ' .. subcmd, vim.log.levels.ERROR)
end
end