feat(compiler): add compile start/complete notifications
Problem: No user-facing feedback when compilation starts or finishes. Long-running compilers like pandoc with `--embed-resources` leave the user staring at nothing for 15+ seconds. Solution: Notify "compiling..." at compile start and "compilation complete" on success. The initial `toggle` call uses a combined "compiling with <name>..." message to avoid stacking two notifications.
This commit is contained in:
parent
047e169c21
commit
e513fc57d1
2 changed files with 19 additions and 2 deletions
|
|
@ -55,6 +55,14 @@ describe('compiler', function()
|
|||
end,
|
||||
})
|
||||
|
||||
local notified = false
|
||||
local orig = vim.notify
|
||||
vim.notify = function(msg)
|
||||
if msg:find('compiling') then
|
||||
notified = true
|
||||
end
|
||||
end
|
||||
|
||||
local provider = { cmd = { 'echo', 'ok' } }
|
||||
local ctx = {
|
||||
bufnr = bufnr,
|
||||
|
|
@ -64,7 +72,9 @@ describe('compiler', function()
|
|||
}
|
||||
|
||||
compiler.compile(bufnr, 'echo', provider, ctx)
|
||||
vim.notify = orig
|
||||
assert.is_true(fired)
|
||||
assert.is_true(notified)
|
||||
|
||||
vim.wait(2000, function()
|
||||
return process_done(bufnr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue