fix(clipboard): set cursor to new line (#335)

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
Aaron Pham 2024-08-28 15:12:44 -04:00 committed by GitHub
parent 2e48174d09
commit d622feedfa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -21,6 +21,11 @@ if Config.support_paste_image() then
if not ok then
return overriden(lines, phase)
end
-- After pasting, insert a new line and set cursor to this line
vim.api.nvim_buf_set_lines(bufnr, -1, -1, false, { "" })
local last_line = vim.api.nvim_buf_line_count(bufnr)
vim.api.nvim_win_set_cursor(0, { last_line, 0 })
end
end)(vim.paste)
end

View File

@ -1273,8 +1273,6 @@ function Sidebar:create_input()
api.nvim_win_set_hl_ns(hint_window, Highlights.hint_ns)
end
show_hint()
api.nvim_create_autocmd({ "TextChanged", "TextChangedI" }, {
group = self.augroup,
buffer = self.input.bufnr,