From ee9e803ae61daace1f9b7906a7c0a9e37b678378 Mon Sep 17 00:00:00 2001 From: Brandon Conway Date: Mon, 15 Mar 2021 09:14:43 -0700 Subject: [PATCH] Don't mark nil or "" buffer names --- lua/harpoon/mark.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/harpoon/mark.lua b/lua/harpoon/mark.lua index 1919eac..2fdfe66 100644 --- a/lua/harpoon/mark.lua +++ b/lua/harpoon/mark.lua @@ -82,6 +82,11 @@ M.add_file = function(file_name_or_buf_id) return end + if buf_name == "" or buf_name == nil then + print("Couldn't find a valid file name to mark, sorry.") + return + end + local config = harpoon.get_mark_config() for idx = 1, #config.marks do if config.marks[idx] == nil then