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.
This commit is contained in:
parent
8d82abe043
commit
a6ae8ad4b7
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user