diff --git a/lua/kitty-scrollback/autocommands.lua b/lua/kitty-scrollback/autocommands.lua index 72db6fb3..3f6150a6 100644 --- a/lua/kitty-scrollback/autocommands.lua +++ b/lua/kitty-scrollback/autocommands.lua @@ -29,6 +29,7 @@ end M.set_paste_buffer_write_autocmd = function() vim.api.nvim_create_autocmd({ 'BufWriteCmd' }, { group = vim.api.nvim_create_augroup('KittyScrollBackNvimPasteBufWriteCmd', { clear = true }), + pattern = '*.ksb_pastebuf', callback = function(paste_event) if paste_event.buf == p.paste_bufid then ksb_kitty_cmds.send_paste_buffer_text_to_kitty_and_quit(true) diff --git a/lua/kitty-scrollback/windows.lua b/lua/kitty-scrollback/windows.lua index 71847018..ed73cf1d 100644 --- a/lua/kitty-scrollback/windows.lua +++ b/lua/kitty-scrollback/windows.lua @@ -91,7 +91,7 @@ M.open_paste_window = function(start_insert) local col = p.pos.col + 1 if not p.paste_bufid then p.paste_bufid = vim.api.nvim_create_buf(false, false) - vim.api.nvim_buf_set_name(p.paste_bufid, vim.fn.tempname()) + vim.api.nvim_buf_set_name(p.paste_bufid, vim.fn.tempname() .. '.ksb_pastebuf') local ft = opts.paste_window.filetype or vim.fn.fnamemodify(vim.o.shell, ':t:r') vim.api.nvim_set_option_value('filetype', ft, { buf = p.paste_bufid,