Skip to content

Commit

Permalink
fix: allow file writing if not the paste buffer (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesmithgh authored Sep 22, 2023
1 parent a65c5e3 commit 87ff296
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lua/kitty-scrollback/autocommands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lua/kitty-scrollback/windows.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 87ff296

Please sign in to comment.