From 60015c1736c596e22a0651748c8444fb3ea1cbca Mon Sep 17 00:00:00 2001 From: Ali Almohaya Date: Mon, 26 Sep 2022 23:57:02 +0300 Subject: [PATCH] fix: do not open exec open file if there is no active buffer --- lua/openingh/init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/openingh/init.lua b/lua/openingh/init.lua index b2d2b0d..f39b007 100644 --- a/lua/openingh/init.lua +++ b/lua/openingh/init.lua @@ -26,6 +26,12 @@ function M.openFile() end local file_path = utils.get_current_relative_file_path() + + if file_path:len() == 0 then + print("There is no active file to open!") + return + end + local current_branch_name = utils.get_current_branch() local file_page_url = M.repo_url .. "/blob/" .. current_branch_name .. file_path