From 1e7075ca9fb59c4f237d747ee7e7fd06baaf183a Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Wed, 5 Jan 2022 23:42:47 +0100 Subject: [PATCH] Do not force choosing project dir to suggestion When changing or opening a project directory do not take the selected item from suggestion but simply the entered text as it is. Otherwise the user may be unable to choose a directory if the text matches the beginning of suggestion. Close #791 --- data/core/commands/core.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/core/commands/core.lua b/data/core/commands/core.lua index 29626c86..971b95f1 100644 --- a/data/core/commands/core.lua +++ b/data/core/commands/core.lua @@ -152,8 +152,8 @@ command.add(nil, { if dirname then core.command_view:set_text(common.home_encode(dirname) .. PATHSEP) end - core.command_view:enter("Change Project Folder", function(text, item) - text = system.absolute_path(common.home_expand(item and item.text or text)) + core.command_view:enter("Change Project Folder", function(text) + text = system.absolute_path(common.home_expand(text)) if text == core.project_dir then return end local path_stat = system.get_file_info(text) if not path_stat or path_stat.type ~= 'dir' then @@ -172,8 +172,8 @@ command.add(nil, { if dirname then core.command_view:set_text(common.home_encode(dirname) .. PATHSEP) end - core.command_view:enter("Open Project", function(text, item) - text = common.home_expand(item and item.text or text) + core.command_view:enter("Open Project", function(text) + text = common.home_expand(text) local path_stat = system.get_file_info(text) if not path_stat or path_stat.type ~= 'dir' then core.error("Cannot open folder %q", text)