Tweak autoformatting
This commit is contained in:
@@ -14,10 +14,12 @@ vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
pattern = "*.gd",
|
||||
callback = function()
|
||||
if vim.fn.executable("gdformat") == 1 then
|
||||
-- format with gdformat
|
||||
vim.cmd("silent !gdformat %")
|
||||
-- reload buffer if changed externally
|
||||
vim.cmd("checktime")
|
||||
else
|
||||
vim.notify("gdformat not found in PATH", vim.log.levels.WARN)
|
||||
vim.notify("gdformat not found in PATH. Run `:checkhealth godotdev` for more info.", vim.log.levels.WARN)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
@@ -4,6 +4,7 @@ M.opts = {
|
||||
editor_host = "127.0.0.1",
|
||||
editor_port = 6005,
|
||||
debug_port = 6006,
|
||||
autostart_editor_server = false,
|
||||
}
|
||||
|
||||
function M.setup(opts)
|
||||
@@ -15,6 +16,13 @@ function M.setup(opts)
|
||||
})
|
||||
|
||||
require("godotdev.start_editor_server")
|
||||
|
||||
local editor_server = require("godotdev.start_editor_server")
|
||||
-- autostart editor server if enabled
|
||||
if M.opts.autostart_editor_server then
|
||||
editor_server.start_editor_server()
|
||||
end
|
||||
|
||||
require("godotdev.reconnect_lsp")
|
||||
require("godotdev.formatting")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user