fix(history_selector): the item.title could exist lineending, which will cause the vim.ui.select crash (#1733)

This commit is contained in:
guanghechen
2025-03-26 21:57:01 +08:00
committed by GitHub
parent 6430d61f0a
commit 2d4ea5d5d6

View File

@@ -75,7 +75,7 @@ function M.open(bufnr, cb)
vim.ui.select(selector_items, {
prompt = "Select Avante History:",
format_item = function(item) return item.name end,
format_item = function(item) return item.name:gsub("\n", "\\n") end,
}, function(choice)
if not choice then return end
cb(choice.filename)