fix: check list.config.encode, default save_on_toggle to false

This commit is contained in:
Will Hopkins 2023-12-11 18:08:00 -08:00
parent bb806acff3
commit fba563ab50
No known key found for this signature in database
GPG Key ID: 643B8C585BABBB68
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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