From a6ae8ad4b7fb142759820a57b08bc49087e2da38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 11 Feb 2025 04:36:19 +0100 Subject: [PATCH] fix(sidebar): reset cursor to beginning of prompt on submit (#1213) This fix is required for users with vim.o.virtualedit="all". Otherwise, the cursor remains at the end of the prompt and has to be manually moved back before entering the next prompt. --- lua/avante/sidebar.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index 38a5a85..a450dac 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -1988,6 +1988,7 @@ function Sidebar:create_input_container(opts) local request = table.concat(lines, "\n") if request == "" then return end api.nvim_buf_set_lines(self.input_container.bufnr, 0, -1, false, {}) + api.nvim_win_set_cursor(self.input_container.winid, { 1, 0 }) handle_submit(request) end