Add command to create a directory in a new category "files"

Use the alt + (left click) is tree view to create a directory and
shift + (middle click) to remove a project directory.
This commit is contained in:
Francesco Abbate
2020-12-30 11:52:26 +01:00
parent 08f36cda1f
commit f2faddbec7
3 changed files with 32 additions and 2 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ end
function command.add_defaults()
local reg = { "core", "root", "command", "doc", "findreplace" }
local reg = { "core", "root", "command", "doc", "findreplace", "files" }
for _, name in ipairs(reg) do
require("core.commands." .. name)
end
+13
View File
@@ -0,0 +1,13 @@
local core = require "core"
local command = require "core.command"
command.add(nil, {
["files:create-directory"] = function()
core.command_view:enter("New directory name", function(text)
local success, err = system.mkdir(text)
if not success then
core.error("cannot create directory %q: %s", text, err)
end
end)
end,
})