feat: add statusline function (#10)
Problem: no way to expose compiling/watching state to statusline
plugins like lualine or heirline without polling status() and
formatting it manually.
Solution: add `require('preview').statusline()` that returns
'compiling', 'watching', or '' for direct use in statusline components.
This commit is contained in:
parent
187474bb3d
commit
bf2f4a78e2
2 changed files with 22 additions and 0 deletions
|
|
@ -100,4 +100,12 @@ describe('preview', function()
|
|||
helpers.delete_buffer(bufnr)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('statusline', function()
|
||||
it('returns empty string when idle', function()
|
||||
local bufnr = helpers.create_buffer({})
|
||||
assert.are.equal('', preview.statusline(bufnr))
|
||||
helpers.delete_buffer(bufnr)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue