File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1762,7 +1762,19 @@ M.cmd.ChatPaste = function(params)
1762
1762
local target = M .resolve_buf_target (params )
1763
1763
1764
1764
last = vim .fn .resolve (last )
1765
- local buf = M .open_buf (last , target , M ._toggle_kind .chat , true )
1765
+ local buf = M ._H .get_buffer (last )
1766
+ local win_found = false
1767
+ if buf then
1768
+ for _ , w in ipairs (vim .api .nvim_list_wins ()) do
1769
+ if vim .api .nvim_win_get_buf (w ) == buf then
1770
+ vim .api .nvim_set_current_win (w )
1771
+ vim .api .nvim_set_current_buf (buf )
1772
+ win_found = true
1773
+ break
1774
+ end
1775
+ end
1776
+ end
1777
+ buf = win_found and buf or M .open_buf (last , target , M ._toggle_kind .chat , true )
1766
1778
1767
1779
M .append_selection (params , cbuf , buf )
1768
1780
M ._H .feedkeys (" G" , " x" )
You can’t perform that action at this time.
0 commit comments