From fba563ab508a367f8807ac030f5cccfb9e9dab81 Mon Sep 17 00:00:00 2001 From: Will Hopkins Date: Mon, 11 Dec 2023 18:08:00 -0800 Subject: [PATCH] fix: check list.config.encode, default save_on_toggle to false --- lua/harpoon/config.lua | 4 ++-- lua/harpoon/init.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/harpoon/config.lua b/lua/harpoon/config.lua index cf2129b..b6b61cf 100644 --- a/lua/harpoon/config.lua +++ b/lua/harpoon/config.lua @@ -14,7 +14,7 @@ M.DEFAULT_LIST = DEFAULT_LIST ---@class HarpoonPartialConfigItem ---@field select_with_nil? boolean defaults to false ----@field encode? (fun(list_item: HarpoonListItem): string) +---@field encode? (fun(list_item: HarpoonListItem): string) | boolean ---@field decode? (fun(obj: string): any) ---@field display? (fun(list_item: HarpoonListItem): string) ---@field select? (fun(list_item?: HarpoonListItem, list: HarpoonList, options: any?): nil) @@ -25,7 +25,7 @@ M.DEFAULT_LIST = DEFAULT_LIST ---@field get_root_dir? fun(): string ---@class HarpoonSettings ----@field save_on_toggle boolean defaults to true +---@field save_on_toggle boolean defaults to false ---@field sync_on_ui_close? boolean ---@field key (fun(): string) diff --git a/lua/harpoon/init.lua b/lua/harpoon/init.lua index 72d9ab1..1746d2e 100644 --- a/lua/harpoon/init.lua +++ b/lua/harpoon/init.lua @@ -86,7 +86,7 @@ end function Harpoon:sync() local key = self.config.settings.key() self:_for_each_list(function(list, _, list_name) - if list.encode == false then + if list.config.encode == false then return end