Work on Open
This commit is contained in:
@@ -253,7 +253,18 @@ function ExtractLineAndColumn(s)
|
||||
end
|
||||
end
|
||||
|
||||
return 0, 0, s
|
||||
return -1, -1, s
|
||||
end
|
||||
|
||||
function BufferNameExists(name)
|
||||
buffers = ListBuffers()
|
||||
for i = 1,#buffers do
|
||||
buff = buffers[i]
|
||||
if buff == name then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function GenericTextFileRule(_s)
|
||||
@@ -286,8 +297,12 @@ function GenericTextFileRule(_s)
|
||||
return s
|
||||
end
|
||||
|
||||
if BufferNameExists(s) then
|
||||
return s
|
||||
end
|
||||
|
||||
-- other_random_filename
|
||||
return s
|
||||
return GetCurrentBufferDir()..'/'..s
|
||||
end
|
||||
|
||||
line, col, _s = ExtractLineAndColumn(_s)
|
||||
@@ -295,21 +310,6 @@ function GenericTextFileRule(_s)
|
||||
return {kind = "text", file_path = file_path, line = line, col = col}
|
||||
end
|
||||
|
||||
-- function RuleFindExistingBuffer(_s)
|
||||
-- line, col, _s = ExtractLineAndColumn(_s)
|
||||
--
|
||||
-- buffers = list_buffers_object()
|
||||
-- for i = 1,#buffers do
|
||||
-- buff = buffers[i]
|
||||
-- if buff == _s then
|
||||
-- return {kind = "text", file_path = buff, line = line, col = col}
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- return nil
|
||||
-- end
|
||||
|
||||
|
||||
Rules = {}
|
||||
Rules[#Rules + 1] = GenericTextFileRule
|
||||
-- Rules[#Rules + 2] = RuleFindExistingBuffer
|
||||
@@ -397,7 +397,7 @@ void GenerateConfig() {
|
||||
Array<Var> style = {};
|
||||
style.add({"DrawLineNumbers", "1"});
|
||||
style.add({"DrawScrollbar", "1"});
|
||||
style.add({"IndentSize", "2"});
|
||||
style.add({"IndentSize", "4"});
|
||||
style.add({"TrimWhitespaceOnSave", "1"});
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user