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
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ lint:

docgen:
nvim --headless --noplugin -u scripts/minimal_init.vim -c "luafile ./scripts/gendocs.lua" -c 'qa'

test-utils:
nvim --headless --noplugin -u scripts/minimal_init.vim -c "lua require('plenary.busted').run('lua/tests/automated/actions/utils_spec.lua', { minimal_init = './scripts/minimal_init.vim' })" -c "qa"
8 changes: 2 additions & 6 deletions lua/telescope/actions/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ local utils = {}
---@param prompt_bufnr number: The prompt bufnr
---@param f function: Function to map onto entries of picker that takes (entry, index, row) as viable arguments
function utils.map_entries(prompt_bufnr, f)
vim.validate {
f = { f, "function" },
}
vim.validate("f", f, "function")
local current_picker = action_state.get_current_picker(prompt_bufnr)
local index = 1
-- indices are 1-indexed, rows are 0-indexed
Expand Down Expand Up @@ -72,9 +70,7 @@ end
---@param prompt_bufnr number: The prompt bufnr
---@param f function: Function to map onto selection of picker that takes (selection) as a viable argument
function utils.map_selections(prompt_bufnr, f)
vim.validate {
f = { f, "function" },
}
vim.validate("f", f, "function")
local current_picker = action_state.get_current_picker(prompt_bufnr)
for _, selection in ipairs(current_picker:get_multi_selection()) do
f(selection)
Expand Down
Loading