Newest nvim updates
This commit is contained in:
18
lua/godot.lua
Normal file
18
lua/godot.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
local vim = vim
|
||||
local paths_to_check = {'/', '/../'}
|
||||
local is_godot_project = false
|
||||
local godot_project_path = ''
|
||||
local cwd = vim.fn.getcwd()
|
||||
|
||||
for key, value in pairs(paths_to_check) do
|
||||
if vim.uv.fs_stat(cwd .. value .. 'project.godot') then
|
||||
is_godot_project = true
|
||||
godot_project_path = cwd .. value
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
local is_server_running = vim.uv.fs_stat(godot_project_path .. '/server.pipe')
|
||||
if is_godot_project and not is_server_running then
|
||||
vim.fn.serverstart(godot_project_path .. '/server.pipe')
|
||||
end
|
||||
Reference in New Issue
Block a user