diff options
author | Araq <rumpf_a@web.de> | 2018-03-22 15:51:23 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-03-22 15:51:23 +0100 |
commit | a0b547001bdf1ec583c4fdc3b2a635da6d2bdfa1 (patch) | |
tree | a7da7c74f90ab6f34ccf8db0dafa9f4270c62f96 /nimsuggest/nimsuggest.nim | |
parent | 7e835a84b8d82611e14c6b0bb48821fd8d79edfd (diff) | |
download | Nim-a0b547001bdf1ec583c4fdc3b2a635da6d2bdfa1.tar.gz |
nimsuggest: do not execute the .nims file when requested to auto-complete it
Diffstat (limited to 'nimsuggest/nimsuggest.nim')
-rw-r--r-- | nimsuggest/nimsuggest.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nimsuggest/nimsuggest.nim b/nimsuggest/nimsuggest.nim index 0328b817a..abfb21c13 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) |