ci: format
This commit is contained in:
parent
96df25b7be
commit
e03f51ca04
1 changed files with 23 additions and 19 deletions
|
|
@ -208,26 +208,30 @@ function M.compile(bufnr, name, provider, ctx, opts)
|
||||||
local watcher = vim.uv.new_fs_event()
|
local watcher = vim.uv.new_fs_event()
|
||||||
if watcher then
|
if watcher then
|
||||||
open_watchers[bufnr] = watcher
|
open_watchers[bufnr] = watcher
|
||||||
watcher:start(out_dir, {}, vim.schedule_wrap(function(err, filename, _events)
|
watcher:start(
|
||||||
if err or vim.fn.fnamemodify(filename or '', ':t') ~= out_name then
|
out_dir,
|
||||||
return
|
{},
|
||||||
end
|
vim.schedule_wrap(function(err, filename, _events)
|
||||||
if opened[bufnr] then
|
if err or vim.fn.fnamemodify(filename or '', ':t') ~= out_name then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if opened[bufnr] then
|
||||||
|
stop_open_watcher(bufnr)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if not vim.api.nvim_buf_is_valid(bufnr) then
|
||||||
|
stop_open_watcher(bufnr)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local new_stat = vim.uv.fs_stat(output_file)
|
||||||
|
if not (new_stat and new_stat.mtime.sec > pre_mtime) then
|
||||||
|
return
|
||||||
|
end
|
||||||
stop_open_watcher(bufnr)
|
stop_open_watcher(bufnr)
|
||||||
return
|
do_open(bufnr, output_file, provider.open)
|
||||||
end
|
opened[bufnr] = true
|
||||||
if not vim.api.nvim_buf_is_valid(bufnr) then
|
end)
|
||||||
stop_open_watcher(bufnr)
|
)
|
||||||
return
|
|
||||||
end
|
|
||||||
local new_stat = vim.uv.fs_stat(output_file)
|
|
||||||
if not (new_stat and new_stat.mtime.sec > pre_mtime) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
stop_open_watcher(bufnr)
|
|
||||||
do_open(bufnr, output_file, provider.open)
|
|
||||||
opened[bufnr] = true
|
|
||||||
end))
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue