aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2022-01-05 23:42:47 +0100
committerFrancesco Abbate <francesco.bbt@gmail.com>2022-01-05 23:42:47 +0100
commit1e7075ca9fb59c4f237d747ee7e7fd06baaf183a (patch)
tree77f884635d07bf7ef3aa6b43dc62c1dd11d7f46d
parent1b57107352dc8c26999febb93e46cb5338a00255 (diff)
downloadlite-xl-1e7075ca9fb59c4f237d747ee7e7fd06baaf183a.tar.gz
lite-xl-1e7075ca9fb59c4f237d747ee7e7fd06baaf183a.zip
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
-rw-r--r--data/core/commands/core.lua8
1 files 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)