Lua_GetProjectPath, SDLK_Period

This commit is contained in:
krzosa
2025-04-30 21:38:21 +02:00
parent a00f8acd9a
commit dc3861adfe
12 changed files with 96 additions and 109 deletions

View File

@@ -401,42 +401,6 @@ function ApplyRules(s)
return nil
end
function IsWhitespace(w)
local result = w == string.byte('\n') or
w == string.byte(' ') or
w == string.byte('\t') or
w == string.byte('\v') or
w == string.byte('\r')
return result
end
function IsSymbol(w)
local result = (w >= string.byte('!') and w <= string.byte('/')) or
(w >= string.byte(':') and w <= string.byte('@')) or
(w >= string.byte('[') and w <= string.byte('`')) or
(w >= string.byte('{') and w <= string.byte('~'))
return result
end
function IsLoadWord(w)
local result = w == string.byte('(') or
w == string.byte(')') or
w == string.byte('/') or
w == string.byte('\\') or
w == string.byte(':') or
w == string.byte('+') or
w == string.byte('_') or
w == string.byte('.') or
w == string.byte('-') or
w == string.byte(',') or
w == string.byte('"') or
w == string.byte("'")
if not result then
result = not (IsSymbol(w) or IsWhitespace(w))
end
return result
end
Coroutines = {}
function AddCo(f)
local i = #Coroutines + 1
@@ -463,8 +427,6 @@ table.insert(OnCommandCallbacks, function (e)
C("git grep -n "..GetLoadWord().." :/") end
if e.key == SDLK_L and e.ctrl == 1 then
Eval(GetLoadWord()) end
if e.key == SDLK_B and e.ctrl == 1 then
C(GetLoadWord()) end
end)
-- REMEBER: AS LITTLE ACTUAL CODE AS POSSIBLE IN LUA