You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.
There are breaking changes if the config of the user:
Uses a custom_formatter function
Changed property empty_slots ( default empty )
Contains { formatter = "extended" }
Changed options in formatter_opts.extended
Changes in the custom formatter
Previously:
Harpoonline.setup({
custom_formatter=Harpoonline.gen_formatter(
---@paramdataHarpoonLineData---@returnstringfunction(data)
-- create and return the lineend
),
})
Now:
The gen_formatter wrapper has been removed
A second argument has been added: opts of type HarpoonlineConfig
Harpoonline.setup({
---@paramdataHarpoonlineData---@paramoptsHarpoonLineConfig---@returnstringcustom_formatter=function(data, opts)
-- create and return the lineend,
})
HarpoonLineData is also changed
Changed the name into HarpoonlineData(lower l)
The data parameter for the custom_formatter used to contain:
---@classHarpoonLineDataH.data= {
-- Harpoon's default list is in use when list_name = nil--- @typestring|nillist_name=nil, -- the name of the current list--- @typenumberlist_length=0, -- the length of the current list--- @typenumber|nilbuffer_idx=nil, -- the mark of the current buffer if harpooned
}
For more flexibility, the actual items in the harpoon list are now provided.
The length of the list can be inferred using #data.items
---@classHarpoonlineData---@fieldlist_namestring|nil -- the name of the current list---@fielditemsHarpoonItem[] -- the items of the current list---@fieldactive_idxnumber|nil -- the harpoon index of the current buffer
See the examples in the readme.
Changes in the extended formatter
Previously, the default formatter to use when not overridden in the config:
---@type"extended" | "short"formatter='extended', -- use a builtin formatter-- Corresponding opts: formatter_opts.extended
The name of the default formatter is now just "default"
---@type"default" | "short"formatter='default', -- use a builtin formatter-- Corresponding opts: formatter_opts.default
Options
Empty slots
The config option for the extended formatter was already disabled:
formatter_opts= {
extended= {
-- 1 More indicators than items in the harpoon list:empty_slot='', -- ' · ', -- middledot. Disable using empty string
},
},
The option has been removed.
Indicators
Previously:
-- formatter_opts.extended
{
-- An indicator corresponds to a position in the harpoon list-- Suggestion: Add an indicator for each configured "select" keybindingindicators= { ' 1 ', ' 2 ', ' 3 ', ' 4 ' },
active_indicators= { '[1]', '[2]', '[3]', '[4]' },
-- Less indicators than items in the harpoon listmore_marks_indicator=' … ', -- horizontal elipsis. Disable using empty stringmore_marks_active_indicator='[…]', -- Disable using empty string
}
Now:
-- formatter_opts.default
{
inactive=' %s ', -- including spacesactive='[%s]',
-- Number of slots to display:max_slots=4, -- Suggestion: as many as there are "select" keybindings-- The number of items in the harpoon list exceeds max_slots:more='…', -- horizontal elipsis. Disable using empty string
}
The output is the same.
Chapter "custom formatters" in the readme includes an extra example displaying letters.
The text was updated successfully, but these errors were encountered:
Breaking changes in v3
There are breaking changes if the config of the user:
custom_formatter
functionempty_slots
( default empty ){ formatter = "extended" }
formatter_opts.extended
Changes in the custom formatter
Previously:
Now:
opts
of typeHarpoonlineConfig
HarpoonLineData
is also changedChanged the name into
HarpoonlineData
(lower l)The data parameter for the
custom_formatter
used to contain:For more flexibility, the actual items in the harpoon list are now provided.
The length of the list can be inferred using
#data.items
See the examples in the readme.
Changes in the extended formatter
Previously, the default formatter to use when not overridden in the config:
The name of the default formatter is now just "default"
Options
Empty slots
The config option for the extended formatter was already disabled:
The option has been removed.
Indicators
Previously:
Now:
The output is the same.
Chapter "custom formatters" in the readme includes an extra example displaying letters.
The text was updated successfully, but these errors were encountered: