From a0b547001bdf1ec583c4fdc3b2a635da6d2bdfa1 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 22 Mar 2018 15:51:23 +0100 Subject: [PATCH] nimsuggest: do not execute the .nims file when requested to auto-complete it --- nimsuggest/nimsuggest.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nimsuggest/nimsuggest.nim b/nimsuggest/nimsuggest.nim index 0328b817a0..abfb21c134 100644 --- a/nimsuggest/nimsuggest.nim +++ b/nimsuggest/nimsuggest.nim @@ -608,9 +608,9 @@ proc handleCmdLine(cache: IdentCache; config: ConfigRef) = options.command = "nimsuggest" let scriptFile = gProjectFull.changeFileExt("nims") if fileExists(scriptFile): - runNimScript(cache, scriptFile, freshDefines=false, config) - # 'nim foo.nims' means to just run the NimScript file and do nothing more: - if scriptFile == gProjectFull: return + # 'nimsuggest foo.nims' means to just auto-complete the NimScript file: + if scriptFile != gProjectFull: + runNimScript(cache, scriptFile, freshDefines=false, config) elif fileExists(gProjectPath / "config.nims"): # directory wide NimScript file runNimScript(cache, gProjectPath / "config.nims", freshDefines=false, config)