Fix browser, fix font, GetExeDir

This commit is contained in:
2025-08-11 13:41:28 +02:00
parent e6414908b7
commit b6ef63e817
7 changed files with 19 additions and 11 deletions

View File

@@ -41,6 +41,7 @@ if [ ! -f "lbaselib.o" ]; then
-c -c
fi fi
cp ../data/*.ttf .
clang ../src/text_editor/text_editor.cpp ../src/basic/unix.cpp \ clang ../src/text_editor/text_editor.cpp ../src/basic/unix.cpp \
-o te_linux.exe \ -o te_linux.exe \
-nostdlib++ -fno-exceptions -fdiagnostics-absolute-paths -g \ -nostdlib++ -fno-exceptions -fdiagnostics-absolute-paths -g \

BIN
data/CascadiaMono.ttf Normal file

Binary file not shown.

View File

@@ -300,10 +300,6 @@ void OnCommand(Event event) {
ToggleVisibility(DebugWindowID); ToggleVisibility(DebugWindowID);
} }
// if (Press(SDLK_F11)) {
// Command_ToggleFullscreen();
// }
if (CtrlPress(SDLK_GRAVE)) { if (CtrlPress(SDLK_GRAVE)) {
if (ActiveWindow != NullWindowID) { if (ActiveWindow != NullWindowID) {
ActiveWindow = NullWindowID; ActiveWindow = NullWindowID;
@@ -585,9 +581,9 @@ void OnCommand(Event event) {
} }
} }
if (CtrlPress(SDLK_N)) { // if (CtrlPress(SDLK_N)) {
Command_New(); // Command_New();
} // }
if (CtrlPress(SDLK_S)) { if (CtrlPress(SDLK_S)) {
SaveBuffer(active.buffer); SaveBuffer(active.buffer);

View File

@@ -66,12 +66,16 @@ Style.DrawScrollbar = 1
Style.IndentSize = 4 Style.IndentSize = 4
Style.FontSize = 15 Style.FontSize = 15
Style.FontFilter = 0 Style.FontFilter = 0
Style.Font = "/home/krz/text_editor/package/CascadiaMono.ttf" Style.Font = GetExeDir().."CascadiaMono.ttf"
Style.VCVarsall = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat" Style.VCVarsall = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat"
Style.TrimWhitespaceOnSave = true Style.TrimWhitespaceOnSave = true
Style.ClangFormatOnSave = false Style.ClangFormatOnSave = false
INTERNET_BROWSER = 'C:/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe' if OS_WINDOWS then
INTERNET_BROWSER = '"C:/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe"'
else
INTERNET_BROWSER = "firefox"
end
OS_WINDOWS = 0 OS_WINDOWS = 0
OS_UNIX = 1 OS_UNIX = 1
@@ -301,7 +305,7 @@ end
function MatchURL(s, meta) function MatchURL(s, meta)
local i, j = string.find(s, "^https://") local i, j = string.find(s, "^https://")
if i then if i then
return {kind = "exec_console", cmd = '"'..INTERNET_BROWSER..'" '..s, working_dir = GetMainDir()} return {kind = "exec_console", cmd = INTERNET_BROWSER.." "..s, working_dir = GetMainDir()}
end end
return nil return nil
end end

View File

@@ -92,6 +92,13 @@ int Lua_GetWorkDir(lua_State *L) {
return 1; return 1;
} }
int Lua_GetExeDir(lua_State *L) {
Scratch scratch;
String exe_dir = GetExeDir(scratch);
lua_pushlstring(L, exe_dir.data, exe_dir.len);
return 1;
}
int Lua_GetMainDir(lua_State *L) { int Lua_GetMainDir(lua_State *L) {
String name = Command_GetMainDir(); String name = Command_GetMainDir();
lua_pushlstring(L, name.data, name.len); lua_pushlstring(L, name.data, name.len);

View File

@@ -10,6 +10,7 @@ luaL_Reg LuaFunctions[] = {
{"GetLine", Lua_GetLine}, {"GetLine", Lua_GetLine},
{"FileExists", Lua_FileExists}, {"FileExists", Lua_FileExists},
{"GetWorkDir", Lua_GetWorkDir}, {"GetWorkDir", Lua_GetWorkDir},
{"GetExeDir", Lua_GetExeDir},
{"GetMainDir", Lua_GetMainDir}, {"GetMainDir", Lua_GetMainDir},
{"SplitSize", Lua_SplitSize}, {"SplitSize", Lua_SplitSize},
{"KillWindow", Lua_KillWindow}, {"KillWindow", Lua_KillWindow},

View File

@@ -1,4 +1,3 @@
- Add GetExeDir to lua, point at font automatically
- Rework PollStdout and stuff there to match both Unix and Windows properly - Rework PollStdout and stuff there to match both Unix and Windows properly
- Add metaprogram? - Add metaprogram?
- Fix windows build - Fix windows build