Small Open improvements
This commit is contained in:
@@ -315,9 +315,26 @@ function GenericTextFileRule(_s)
|
||||
return {kind = "text", file_path = file_path, line = line, col = col}
|
||||
end
|
||||
|
||||
Rules = {}
|
||||
Rules[#Rules + 1] = GenericTextFileRule
|
||||
-- Rules[#Rules + 2] = RuleFindExistingBuffer
|
||||
function MatchAgainstIncludes(s)
|
||||
line, col, s = ExtractLineAndColumn(s)
|
||||
include_paths = {
|
||||
"C:/Work/text_editor/src",
|
||||
"C:/Work/text_editor/src/text_editor",
|
||||
}
|
||||
for i = 1,#include_paths do
|
||||
file_path = include_paths[i] .. '/' .. s
|
||||
if FileExists(file_path) then
|
||||
return {kind = "text", file_path = file_path, line = line, col = col}
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
Rules = {
|
||||
GenericTextFileRule,
|
||||
MatchAgainstIncludes,
|
||||
}
|
||||
|
||||
function ApplyRules(s)
|
||||
for i = #Rules,1,-1 do
|
||||
|
||||
Reference in New Issue
Block a user