Success running on linux
This commit is contained in:
@@ -2,6 +2,8 @@ Style.TrimWhitespaceOnSave = true
|
||||
Style.ClangFormatOnSave = false
|
||||
|
||||
INTERNET_BROWSER = 'C:/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe'
|
||||
OS_WINDOWS = 0
|
||||
OS_UNIX = 1
|
||||
|
||||
SDLK_CTRL = 1073742048
|
||||
SDLK_PAGE_DOWN = 1073741902
|
||||
@@ -144,7 +146,7 @@ function SkipDrive(s)
|
||||
return new_s, drive, true
|
||||
end
|
||||
|
||||
function SkipPathCell(s)
|
||||
function WindowsSkipPathCell(s)
|
||||
local i, j = s:find("^[%w_%.-% +]+")
|
||||
if not i then return s, nil, false end
|
||||
|
||||
@@ -155,7 +157,7 @@ function SkipPathCell(s)
|
||||
return new_s, word, found_slash
|
||||
end
|
||||
|
||||
function SkipPath(s)
|
||||
function WindowsSkipPath(s)
|
||||
local input_s = s
|
||||
local s, drive, ok = SkipDrive(s)
|
||||
if not ok then return s end
|
||||
@@ -166,7 +168,7 @@ function SkipPath(s)
|
||||
end
|
||||
|
||||
while true do
|
||||
s, word, slash_eaten = SkipPathCell(s)
|
||||
s, word, slash_eaten = WindowsSkipPathCell(s)
|
||||
if word then cells[#cells + 1] = word end
|
||||
if not slash_eaten then break end
|
||||
end
|
||||
@@ -179,7 +181,7 @@ function SkipPath(s)
|
||||
end
|
||||
|
||||
function MatchWindowsPath(_s, meta)
|
||||
local s, file_path, drive = SkipPath(_s)
|
||||
local s, file_path, drive = WindowsSkipPath(_s)
|
||||
|
||||
if not file_path and FileExists(drive) then
|
||||
return {kind = "text", file_path = drive, line = line, col = col}
|
||||
@@ -201,6 +203,22 @@ function MatchWindowsPath(_s, meta)
|
||||
return {kind = "text", file_path = file_path, line = line, col = col}
|
||||
end
|
||||
|
||||
function MatchUnixPath(s, meta)
|
||||
local i, j = s:find("^[%w_%.-% %/]+")
|
||||
local path = s:sub(i, j)
|
||||
local rest = s:sub(j + 1, -1)
|
||||
local line, col, s = SkipLineAndColumn(rest)
|
||||
Print(path, rest, line, col)
|
||||
|
||||
return {kind = "text", file_path = path, line = line, col = col}
|
||||
end
|
||||
|
||||
if OS_VALUE == OS_WINDOWS then
|
||||
MatchPath = MatchWindowsPath
|
||||
else
|
||||
MatchPath = MatchUnixPath
|
||||
end
|
||||
|
||||
function MatchGitCommit(s, meta)
|
||||
local i, j = string.find(s, "^commit ([a-zA-Z0-9]+)")
|
||||
if i then
|
||||
@@ -255,7 +273,7 @@ function MatchExec(s, meta)
|
||||
end
|
||||
|
||||
BuiltinOnOpenMatchers = {
|
||||
MatchWindowsPath,
|
||||
MatchPath,
|
||||
MatchGitCommit,
|
||||
MatchURL,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user