bypass reloading error when using pascal formatter

This commit is contained in:
Yannick Reiß 2024-09-24 05:41:41 +02:00
parent 7452ee9b06
commit b8c5c86010
1 changed files with 2 additions and 1 deletions

View File

@ -8,7 +8,6 @@ end
-- @short Verify installation of pascal tools or install them.
local function setup_pascal()
local check_ptop = { os.execute("which ptop") }
vim.cmd("set autoread")
-- if return value is 1, get ptop
if check_ptop == 1 then
@ -27,11 +26,13 @@ vim.api.nvim_create_autocmd({ "BufEnter" }, {
-- @param
-- @short The format function for pascal.
local function auto_format()
vim.cmd("checktime %")
local write_cmd = "ptop -c ~/.config/nvim/ptop.conf "
.. vim.api.nvim_buf_get_name(0)
.. " "
.. vim.api.nvim_buf_get_name(0)
os.execute(write_cmd)
vim.cmd("checktime %")
end
-- Add formatter command