From 84096697723a10d42bb5f44c9f97e8f86beeb773 Mon Sep 17 00:00:00 2001 From: Nick Burt Date: Tue, 10 Feb 2026 21:11:59 -0600 Subject: [PATCH] fix accurate check if in godot directory --- init.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index ab84097b..644410f0 100644 --- a/init.lua +++ b/init.lua @@ -881,12 +881,14 @@ require('lazy').setup({ -- FIX: godot-server: this is preventing multiple nvim sessions from running at the same time -- FIX: godot-server: might be launching the server despite not being in a godot directory? -- FIX: godot-server: Also, it really should check if the server is already running first... -local gdprojectfile = vim.fn.getcwd() == '/project.godot' -if gdprojectfile then vim.fn.serverstart '127.0.0.1:55432' end +local gdprojectfilepath = vim.fn.getcwd() .. '/project.godot' +local isInGdDirectory = vim.fn.filereadable(gdprojectfilepath) == 1 + +if isInGdDirectory then vim.fn.serverstart '127.0.0.1:55432' end --TODO: godot-server: delete logging logic -print(gdprojectfile) -if gdprojectfile then print 'running in gd project file' end +if isInGdDirectory then print 'running in gd project file' end +print(vim.fn.filereadable(gdprojectfilepath)) -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et