Global: support for named format arguments

Fix #796
This commit is contained in:
Carter Li
2024-05-27 16:41:37 +08:00
parent 965777323e
commit c8451cab52
65 changed files with 855 additions and 806 deletions
+9 -3
View File
@@ -15,10 +15,16 @@ static inline char* realpath(const char* restrict file_name, char* restrict reso
const char* ffDetectEditor(FFEditorResult* result)
{
ffStrbufSetS(&result->name, getenv("VISUAL"));
if (result->name.length == 0)
if (result->name.length)
result->type = "Visual";
else
{
ffStrbufSetS(&result->name, getenv("EDITOR"));
if (result->name.length == 0)
return "$VISUAL or $EDITOR not set";
if (result->name.length)
result->type = "Editor";
else
return "$VISUAL or $EDITOR not set";
}
#ifndef _WIN32
if (result->name.chars[0] != '/')
+1
View File
@@ -4,6 +4,7 @@
typedef struct FFEditorResult
{
const char* type;
FFstrbuf name;
FFstrbuf exe;
FFstrbuf path;