|
|
@ -493,10 +493,11 @@ function TextEditor:readFileContent(file_path)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function TextEditor:saveFileContent(file_path, content)
|
|
|
|
function TextEditor:saveFileContent(file_path, content)
|
|
|
|
local file, err = io.open(file_path, "wb")
|
|
|
|
local ok, err = util.writeToFile(content, file_path)
|
|
|
|
if file then
|
|
|
|
if ok then
|
|
|
|
file:write(content)
|
|
|
|
if self.ui.file_chooser then
|
|
|
|
file:close()
|
|
|
|
self.ui.file_chooser:refreshPath()
|
|
|
|
|
|
|
|
end
|
|
|
|
logger.info("TextEditor: saved file", file_path)
|
|
|
|
logger.info("TextEditor: saved file", file_path)
|
|
|
|
return true
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
|