mzte-nv: completely implement :TypstWatch command

This commit is contained in:
LordMZTE 2024-11-18 07:52:07 +01:00
parent 595680ef81
commit 220086dbde
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6

View file

@ -14,8 +14,14 @@
(.. "typst watch --root " root
" " file " " outfile)
(.. "typst watch " file " "
outfile))})]
outfile))})
viewer-timer (vim.uv.new_timer)]
(term:toggle)
(vim.uv.spawn :zathura {:args [outfile]}
(fn [code signal] (term:shutdown)))))]
(viewer-timer:start 2000 0
(fn []
(viewer-timer:stop)
(viewer-timer:close)
(vim.uv.spawn :zathura {:args [outfile]}
(fn [code signal]
(vim.schedule #(term:shutdown))))))))]
(vim.api.nvim_create_user_command :TypstWatch cb {:nargs 0}))