Made lite set project dir to CWD; removed core.project_dir

Fixes #100
This commit is contained in:
rxi
2020-05-17 17:05:56 +01:00
parent c1f731e5a1
commit 4ae0d477c0
4 changed files with 21 additions and 15 deletions
+3 -3
View File
@@ -56,13 +56,13 @@ command.add(nil, {
["core:file-finder"] = function()
core.command_view:enter("Open File From Project", function(text, item)
text = core.project_dir .. PATHSEP .. (item and item.text or text)
text = item and item.text or text
core.root_view:open_doc(core.open_doc(text))
end, function(text)
local files = {}
for _, item in pairs(core.project_files) do
if item.type == "file" then
table.insert(files, item.filename:sub(#core.project_dir + 2))
table.insert(files, item.filename)
end
end
return common.fuzzy_match(files, text)
@@ -89,7 +89,7 @@ command.add(nil, {
end,
["core:open-project-module"] = function()
local filename = core.project_dir .. "/.lite_project.lua"
local filename = ".lite_project.lua"
if system.get_file_info(filename) then
core.root_view:open_doc(core.open_doc(filename))
else