Binary: support Windows

This commit is contained in:
李通洲
2024-08-22 16:41:06 +08:00
committed by 李通洲
parent cf9bd0f373
commit b4aac9d7d7
3 changed files with 46 additions and 4 deletions
+5 -3
View File
@@ -57,15 +57,15 @@ const char* ffDetectEditor(FFEditorResult* result)
else
{
const char* error = ffFindExecutableInPath(result->name.chars, &result->path);
if (error) return error;
if (error) return NULL;
}
if (!instance.config.general.detectVersion) return NULL;
char buf[PATH_MAX + 1];
if (!realpath(result->path.chars, buf))
return NULL;
// WIN32: Should we handle scoop shim exe here?
ffStrbufSetS(&result->path, buf);
{
@@ -88,6 +88,8 @@ const char* ffDetectEditor(FFEditorResult* result)
#endif
}
if (!instance.config.general.detectVersion) return NULL;
if (ffStrbufEqualS(&result->exe, "nvim"))
ffBinaryExtractStrings(buf, extractNvimVersion, &result->version);
else if (ffStrbufEqualS(&result->exe, "vim"))