diff --git a/lua/harpoon/init.lua b/lua/harpoon/init.lua index 69bf98c..004597b 100644 --- a/lua/harpoon/init.lua +++ b/lua/harpoon/init.lua @@ -88,8 +88,8 @@ local function ensure_correct_config(config) end local marks = proj.mark.marks - for idx = 1, #marks do - local mark = marks[idx] + + for idx, mark in pairs(marks) do if type(mark) == "string" then mark = { filename = mark, diff --git a/lua/harpoon/mark.lua b/lua/harpoon/mark.lua index fbbb7c5..de706f7 100644 --- a/lua/harpoon/mark.lua +++ b/lua/harpoon/mark.lua @@ -269,11 +269,10 @@ M.get_length = function() end M.set_current_at = function(idx) - local config = harpoon.get_mark_config() local buf_name = get_buf_name() - local current_idx = M.get_index_of(buf_name) - log.trace("set_current_at(): Setting id", idx, buf_name) + local config = harpoon.get_mark_config() + local current_idx = M.get_index_of(buf_name) -- Remove it if it already exists if M.valid_index(current_idx) then