Skip to content
Open
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
9 changes: 9 additions & 0 deletions lua/telescope/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,15 @@ append(
}]]
)

append(
"attach_mappings",
nil,
[[
Defines the `attach_mappings` function that will be used as default for all pickers
If you define `attach_mappings` on specific picker, that'll be used instead.
Default: nil ]]
)

append(
"use_less",
true,
Expand Down
2 changes: 2 additions & 0 deletions lua/telescope/pickers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1535,8 +1535,10 @@ end
---@return Picker
pickers.new = function(opts, defaults)
opts = opts or {}
opts.attach_mappings = opts.attach_mappings or config.values.attach_mappings
defaults = defaults or {}
local result = {}
-- Inspect(opts)

for k, v in pairs(opts) do
assert(type(k) == "string" or type(k) == "number", "Should be string or number, found: " .. type(k))
Expand Down