Поддержка клиентских соединений с FTP-серверами прям из проводника

This commit is contained in:
Igor Timofeev
2018-03-15 22:39:31 +03:00
parent 51ba069e45
commit 7e86a4e1d7
10 changed files with 780 additions and 272 deletions

View File

@@ -672,22 +672,25 @@ local function newFile()
end
local function loadFile(path)
newFile()
local file = io.open(path, "r")
for line in file:lines() do
line = removeWindowsLineEndings(removeTabs(line))
table.insert(mainContainer.codeView.lines, line)
mainContainer.codeView.maximumLineLength = math.max(mainContainer.codeView.maximumLineLength, unicode.len(line))
local file, reason = io.open(path, "r")
if file then
newFile()
for line in file:lines() do
line = removeWindowsLineEndings(removeTabs(line))
table.insert(mainContainer.codeView.lines, line)
mainContainer.codeView.maximumLineLength = math.max(mainContainer.codeView.maximumLineLength, unicode.len(line))
end
file:close()
if #mainContainer.codeView.lines > 1 then
table.remove(mainContainer.codeView.lines, 1)
end
mainContainer.leftTreeView.selectedItem = path
updateAutocompleteDatabaseFromFile()
else
GUI.error(reason)
end
file:close()
if #mainContainer.codeView.lines > 1 then
table.remove(mainContainer.codeView.lines, 1)
end
mainContainer.leftTreeView.selectedItem = path
updateAutocompleteDatabaseFromFile()
end
local function saveFile(path)