Use the active view's filename when opening a file
This commit is contained in:
parent
c859498d68
commit
2e7817f609
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue