Use the active view's filename when opening a file

This commit is contained in:
adamharrison
2021-04-25 20:58:56 +02:00
committed by GitHub
parent c859498d68
commit 2e7817f609
+4
View File
@@ -86,6 +86,10 @@ command.add(nil, {
end,
["core:open-file"] = function()
local view = core.active_view
if view and view.doc and view.doc.filename then
core.command_view:set_text((view.doc.filename:find("%.%.") and view.doc.abs_filename or view.doc.filename):match("(.*[/\\])(.+)$"))
end
core.command_view:enter("Open File", function(text)
core.root_view:open_doc(core.open_doc(common.home_expand(text)))
end, function (text)