Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/yankbank/menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ local function get_display_lines()
display_lines,
string.rep(" ", max_digits + 2) .. opts.sep
)
table.insert(line_yank_map, false)
end
table.insert(line_yank_map, false)
end
end

Expand Down
17 changes: 7 additions & 10 deletions lua/yankbank/pickers/snacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ local snacks_source = {
local yank = yanks[i]
local yank_text = yank.yank_text
table.insert(items, {
label = tostring(i),
reg = tostring(i),
-- This is not used right now, but might be useful in the future
-- to determine how to paste the content
-- we may use the reg_type for repopulating the registers on paste
reg_type = yank.reg_type,
-- data is used as the paste content
data = yank_text,
-- text is used by the matcher for searching
text = yank_text,
-- value is used to display in the picker
-- text is used by the matcher for searching and to show in the preview buffer
-- we trim prefix/suffix whitespace for readability
text = vim.trim(yank_text),
-- value is actual content pasted
value = yank_text,
preview = {
-- show original, untrimmed content in preview window
text = yank_text,
-- Currently this is pinned to the current buffer's filetype
-- as we don't store the filetype of each yank.
Expand All @@ -34,7 +31,7 @@ local snacks_source = {
end
return items
end,
format = "register",
format = "text",
preview = "preview",
confirm = function(picker, selected)
picker:close()
Expand Down
Loading