Merge remote-tracking branch 'origin/master' into dev

This commit is contained in:
Francesco Abbate
2021-02-09 18:39:39 +01:00
4 changed files with 21 additions and 14 deletions
+8 -8
View File
@@ -37,8 +37,8 @@ local function normalize_path(s)
end
local function add_project_to_recents(dirname)
dirname = normalize_path(system.absolute_path(dirname))
local function add_project_to_recents(dir_path_abs)
local dirname = normalize_path(dir_path_abs)
if not dirname then return end
local recents = core.recent_projects
local n = #recents
@@ -74,11 +74,11 @@ function core.set_project_dir(new_dir, change_project_fn)
end
function core.open_folder_project(dirname)
if core.set_project_dir(dirname, core.on_quit_project) then
function core.open_folder_project(dir_path_abs)
if core.set_project_dir(dir_path_abs, core.on_quit_project) then
core.root_view:close_all_docviews()
add_project_to_recents(dirname)
core.on_enter_project(dirname)
add_project_to_recents(dir_path_abs)
core.on_enter_project(dir_path_abs)
end
end
@@ -381,7 +381,7 @@ function core.init()
local project_dir_abs = system.absolute_path(project_dir)
local set_project_ok = core.set_project_dir(project_dir_abs)
if set_project_ok then
add_project_to_recents(project_dir)
add_project_to_recents(project_dir_abs)
else
core.error("Cannot enter project directory %q", project_dir)
project_dir_abs = system.absolute_path(".")
@@ -460,7 +460,7 @@ end
function core.temp_filename(ext)
temp_file_counter = temp_file_counter + 1
return EXEDIR .. PATHSEP .. temp_file_prefix
return USERDIR .. PATHSEP .. temp_file_prefix
.. string.format("%06x", temp_file_counter) .. (ext or "")
end