Skip to content

Commit 2d4ea5d

Browse files
authoredMar 26, 2025
fix(history_selector): the item.title could exist lineending, which will cause the vim.ui.select crash (#1733)
1 parent 6430d61 commit 2d4ea5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎lua/avante/history_selector.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function M.open(bufnr, cb)
7575

7676
vim.ui.select(selector_items, {
7777
prompt = "Select Avante History:",
78-
format_item = function(item) return item.name end,
78+
format_item = function(item) return item.name:gsub("\n", "\\n") end,
7979
}, function(choice)
8080
if not choice then return end
8181
cb(choice.filename)

0 commit comments

Comments
 (0)