Use new CommandView:enter options table

This commit is contained in:
Guldoman
2022-05-30 22:08:13 +02:00
parent e4a806a9d0
commit 11e27c6fda
10 changed files with 321 additions and 262 deletions
+7 -5
View File
@@ -4,11 +4,13 @@ local common = require "core.common"
command.add(nil, {
["files:create-directory"] = function()
core.command_view:enter("New directory name", function(text)
local success, err, path = common.mkdirp(text)
if not success then
core.error("cannot create directory %q: %s", path, err)
core.command_view:enter("New directory name", {
submit = function(text)
local success, err, path = common.mkdirp(text)
if not success then
core.error("cannot create directory %q: %s", path, err)
end
end
end)
})
end,
})