hi, are there any general guidelines on how to migrate code from old contexts configs to the new functions?
Example, I have a custom buffer context with an integration with snacks.picker.
contexts = {
buffer = {
description = "Pick a buffer to include in chat context.",
input = function(callback)
local chat_winid = vim.api.nvim_get_current_win()
Snacks.picker.buffers({
confirm = function(picker, item)
picker:close()
-- Return focus to the chat window
if vim.api.nvim_win_is_valid(chat_winid) then
vim.api.nvim_set_current_win(chat_winid)
vim.cmd("normal! a")
end
vim.schedule(function()
callback(item.buf)
end)
end,
})
end,
},
}
How do I migrate this to functions?
hi, are there any general guidelines on how to migrate code from old
contextsconfigs to the newfunctions?Example, I have a custom
buffercontext with an integration withsnacks.picker.How do I migrate this to
functions?