From 2d4ea5d5d659ee1d19d1d3fdc8fb2498d1388d4a Mon Sep 17 00:00:00 2001 From: guanghechen <42513619+guanghechen@users.noreply.github.com> Date: Wed, 26 Mar 2025 21:57:01 +0800 Subject: [PATCH] fix(history_selector): the item.title could exist lineending, which will cause the vim.ui.select crash (#1733) --- lua/avante/history_selector.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/avante/history_selector.lua b/lua/avante/history_selector.lua index c05d758..c88981b 100644 --- a/lua/avante/history_selector.lua +++ b/lua/avante/history_selector.lua @@ -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)