From f0306b04f210e6b127d882009cdbc6d3e997c033 Mon Sep 17 00:00:00 2001 From: Vadim Grigoruk Date: Thu, 25 Oct 2018 09:01:04 +0300 Subject: [PATCH] fixed squirrel for the text projects --- src/console.c | 18 ++++++++++++------ src/surf.c | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/console.c b/src/console.c index 5c19174..dba4848 100644 --- a/src/console.c +++ b/src/console.c @@ -690,18 +690,21 @@ static bool hasExt(const char* name, const char* ext) static bool hasProjectExt(const char* name) { - return hasExt(name, PROJECT_LUA_EXT) || - hasExt(name, PROJECT_MOON_EXT) || - hasExt(name, PROJECT_JS_EXT) || - hasExt(name, PROJECT_WREN_EXT) || - hasExt(name, PROJECT_FENNEL_EXT); + return hasExt(name, PROJECT_LUA_EXT) + || hasExt(name, PROJECT_MOON_EXT) + || hasExt(name, PROJECT_JS_EXT) + || hasExt(name, PROJECT_WREN_EXT) + || hasExt(name, PROJECT_SQUIRREL_EXT) + || hasExt(name, PROJECT_FENNEL_EXT); } static const char* projectComment(const char* name) { char* comment; - if(hasExt(name, PROJECT_JS_EXT) || hasExt(name, PROJECT_WREN_EXT)) + if(hasExt(name, PROJECT_JS_EXT) + || hasExt(name, PROJECT_WREN_EXT) + || hasExt(name, PROJECT_SQUIRREL_EXT)) comment = "//"; else if(hasExt(name, PROJECT_FENNEL_EXT)) comment = ";;"; @@ -1085,6 +1088,9 @@ static void onConsoleLoadCommandConfirmed(Console* console, const char* param) if(!fsExistsFile(console->fs, name)) name = getName(param, PROJECT_FENNEL_EXT); + if(!fsExistsFile(console->fs, name)) + name = getName(param, PROJECT_SQUIRREL_EXT); + void* data = fsLoadFile(console->fs, name, &size); if(data) diff --git a/src/surf.c b/src/surf.c index baa2797..84500fb 100644 --- a/src/surf.c +++ b/src/surf.c @@ -397,6 +397,7 @@ static bool addMenuItem(const char* name, const char* info, s32 id, void* ptr, b || hasExt(name, PROJECT_JS_EXT) || hasExt(name, PROJECT_WREN_EXT) || hasExt(name, PROJECT_FENNEL_EXT) + || hasExt(name, PROJECT_SQUIRREL_EXT) #endif ) {