feat: execute latex compile in directory of file
This commit is contained in:
@@ -18,12 +18,14 @@ M.compile = function(options)
|
||||
return
|
||||
end
|
||||
|
||||
local filename = vim.fn.bufname(bufnr)
|
||||
local filename = vim.api.nvim_buf_get_name(bufnr)
|
||||
|
||||
if filename:sub(- #".tex") == ".tex" then
|
||||
M.compiling_buffers[bufnr] = true
|
||||
local start_idx, _ = filename:find("/[%w%-_%.]+%.tex")
|
||||
local path = filename:sub(1, start_idx - 1)
|
||||
|
||||
vim.system({ "pdflatex", filename }, {}, function()
|
||||
vim.system({ "pdflatex", filename }, { cwd = path }, function()
|
||||
M.compiling_buffers[bufnr] = nil
|
||||
end)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user