fix: normalize notify prefix to [preview.nvim]: everywhere
Problem: some vim.notify calls used [preview.nvim] (no colon) while others used [preview.nvim]: — inconsistent with the log module format. Solution: add the missing colon and space to all notify calls in init.lua and compiler.lua so every user-facing message matches the [preview.nvim]: prefix used by the log module.
This commit is contained in:
parent
f87f478612
commit
845fabb433
2 changed files with 7 additions and 7 deletions
|
|
@ -408,7 +408,7 @@ end
|
|||
---@param ctx preview.Context
|
||||
function M.clean(bufnr, name, provider, ctx)
|
||||
if not provider.clean then
|
||||
vim.notify('[preview.nvim] provider "' .. name .. '" has no clean command', vim.log.levels.WARN)
|
||||
vim.notify('[preview.nvim]: provider "' .. name .. '" has no clean command', vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
|
|
@ -432,10 +432,10 @@ function M.clean(bufnr, name, provider, ctx)
|
|||
vim.schedule_wrap(function(result)
|
||||
if result.code == 0 then
|
||||
log.dbg('clean succeeded for buffer %d', bufnr)
|
||||
vim.notify('[preview.nvim] clean complete', vim.log.levels.INFO)
|
||||
vim.notify('[preview.nvim]: clean complete', vim.log.levels.INFO)
|
||||
else
|
||||
log.dbg('clean failed for buffer %d (exit code %d)', bufnr, result.code)
|
||||
vim.notify('[preview.nvim] clean failed: ' .. (result.stderr or ''), vim.log.levels.ERROR)
|
||||
vim.notify('[preview.nvim]: clean failed: ' .. (result.stderr or ''), vim.log.levels.ERROR)
|
||||
end
|
||||
end)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ function M.build(bufnr)
|
|||
bufnr = bufnr or vim.api.nvim_get_current_buf()
|
||||
local name = M.resolve_provider(bufnr)
|
||||
if not name then
|
||||
vim.notify('[preview.nvim] no provider configured for this filetype', vim.log.levels.WARN)
|
||||
vim.notify('[preview.nvim]: no provider configured for this filetype', vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
local ctx = M.build_context(bufnr)
|
||||
|
|
@ -167,7 +167,7 @@ function M.clean(bufnr)
|
|||
bufnr = bufnr or vim.api.nvim_get_current_buf()
|
||||
local name = M.resolve_provider(bufnr)
|
||||
if not name then
|
||||
vim.notify('[preview.nvim] no provider configured for this filetype', vim.log.levels.WARN)
|
||||
vim.notify('[preview.nvim]: no provider configured for this filetype', vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
local ctx = M.build_context(bufnr)
|
||||
|
|
@ -180,7 +180,7 @@ function M.watch(bufnr)
|
|||
bufnr = bufnr or vim.api.nvim_get_current_buf()
|
||||
local name = M.resolve_provider(bufnr)
|
||||
if not name then
|
||||
vim.notify('[preview.nvim] no provider configured for this filetype', vim.log.levels.WARN)
|
||||
vim.notify('[preview.nvim]: no provider configured for this filetype', vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
local provider = config.providers[name]
|
||||
|
|
@ -193,7 +193,7 @@ function M.open(bufnr)
|
|||
local name = M.resolve_provider(bufnr)
|
||||
local open_config = name and config.providers[name] and config.providers[name].open
|
||||
if not compiler.open(bufnr, open_config) then
|
||||
vim.notify('[preview.nvim] no output file available for this buffer', vim.log.levels.WARN)
|
||||
vim.notify('[preview.nvim]: no output file available for this buffer', vim.log.levels.WARN)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue