Unified open and saving style. (#189)

This commit is contained in:
Adam
2021-05-17 09:29:51 +02:00
committed by GitHub
parent 85d0d684de
commit e43f1b9df9
2 changed files with 5 additions and 1 deletions
+3
View File
@@ -299,6 +299,9 @@ local commands = {
["doc:save-as"] = function()
if doc().filename then
core.command_view:set_text(doc().filename)
elseif core.last_active_view then
local dirname, filename = core.last_active_view.doc.abs_filename:match("(.*)[/\\](.+)$")
core.command_view:set_text(core.normalize_to_project_dir(dirname) .. PATHSEP)
end
core.command_view:enter("Save As", function(filename)
save(common.home_expand(filename))