Fix problem when opening project's module document
It wasn't fine to call core.open_doc without filename argument and later call Doc:save without providing both the filename and the absolute filename. It was giving a Doc in an inconsistent status where self.filename was set but not self.abs_filename. Added an asset to detect early the problem if ever happens again. In turn the problem prevented the project's module hook to work if the file was newly created.
This commit is contained in:
@@ -141,14 +141,9 @@ command.add(nil, {
|
||||
end,
|
||||
|
||||
["core:open-project-module"] = function()
|
||||
local filename = ".lite_project.lua"
|
||||
if system.get_file_info(filename) then
|
||||
core.root_view:open_doc(core.open_doc(filename))
|
||||
else
|
||||
local doc = core.open_doc()
|
||||
core.root_view:open_doc(doc)
|
||||
doc:save(filename)
|
||||
end
|
||||
local doc = core.open_doc(".lite_project.lua")
|
||||
core.root_view:open_doc(doc)
|
||||
doc:save()
|
||||
end,
|
||||
|
||||
["core:change-project-folder"] = function()
|
||||
|
||||
Reference in New Issue
Block a user