From 8acb3fae8c9bdcd1187f9b372f22bda74f67f4f3 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Mon, 24 May 2021 17:26:16 -0400 Subject: [PATCH] Fixed minor error that occurs when saving as after viewing a non-doc tab. --- data/core/commands/doc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/core/commands/doc.lua b/data/core/commands/doc.lua index 6acc4e8b..938f9c59 100644 --- a/data/core/commands/doc.lua +++ b/data/core/commands/doc.lua @@ -343,7 +343,7 @@ local commands = { ["doc:save-as"] = function() if doc().filename then core.command_view:set_text(doc().filename) - elseif core.last_active_view then + elseif core.last_active_view and core.last_active_view.doc 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