From 24669293c71a2a34ad9a4ba528ddcb45323350d3 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Sun, 7 Nov 2021 17:54:42 -0500 Subject: [PATCH 1/2] Made it so that we originally start on the parent directory of the current project, but provide a list of recently used projects if on that directory. If a directory separator is added, then everything is as normal. --- data/core/commands/core.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/data/core/commands/core.lua b/data/core/commands/core.lua index e836ea2f..2280f620 100644 --- a/data/core/commands/core.lua +++ b/data/core/commands/core.lua @@ -9,7 +9,8 @@ local fullscreen = false local function suggest_directory(text) text = common.home_expand(text) - return common.home_encode_list(text == "" and core.recent_projects or common.dir_path_suggest(text)) + return common.home_encode_list(text == "" or text == common.home_expand(common.dirname(core.project_dir)) + and core.recent_projects or common.dir_path_suggest(text)) end command.add(nil, { @@ -149,7 +150,7 @@ command.add(nil, { ["core:change-project-folder"] = function() local dirname = common.dirname(core.project_dir) if dirname then - core.command_view:set_text(common.home_encode(dirname) .. PATHSEP) + core.command_view:set_text(common.home_encode(dirname)) end core.command_view:enter("Change Project Folder", function(text, item) text = system.absolute_path(common.home_expand(item and item.text or text)) @@ -166,7 +167,7 @@ command.add(nil, { ["core:open-project-folder"] = function() local dirname = common.dirname(core.project_dir) if dirname then - core.command_view:set_text(common.home_encode(dirname) .. PATHSEP) + core.command_view:set_text(common.home_encode(dirname)) end core.command_view:enter("Open Project", function(text, item) text = common.home_expand(item and item.text or text) From 5b8c08e93ae3cb79b4e0602e0cc74e90e6d695e5 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Sun, 7 Nov 2021 17:57:15 -0500 Subject: [PATCH 2/2] Missing parentheses. --- data/core/commands/core.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/core/commands/core.lua b/data/core/commands/core.lua index 2280f620..62be4bc6 100644 --- a/data/core/commands/core.lua +++ b/data/core/commands/core.lua @@ -9,7 +9,7 @@ local fullscreen = false local function suggest_directory(text) text = common.home_expand(text) - return common.home_encode_list(text == "" or text == common.home_expand(common.dirname(core.project_dir)) + return common.home_encode_list((text == "" or text == common.home_expand(common.dirname(core.project_dir))) and core.recent_projects or common.dir_path_suggest(text)) end