Skip to content

Commit

Permalink
fix: disable swapfile for kitty-scrollback buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesmithgh committed May 16, 2024
1 parent e947826 commit 772acac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions lua/kitty-scrollback/footer_win.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ M.open_footer_window = function(winopts, refresh_only)
-- if buffer already exists, assume window is already created and just read
p.footer_bufid = vim.api.nvim_create_buf(false, true)
vim.api.nvim_buf_set_name(p.footer_bufid, vim.fn.tempname() .. '.ksb_footerbuf')
vim.api.nvim_set_option_value('filetype', 'help', {
buf = p.footer_bufid,
})
vim.api.nvim_set_option_value('filetype', 'help', { buf = p.footer_bufid })
vim.api.nvim_set_option_value('swapfile', false, { buf = p.paste_bufid })

p.footer_winid = vim.api.nvim_open_win(p.footer_bufid, false, M.footer_winopts(winopts))

Expand Down
1 change: 1 addition & 0 deletions lua/kitty-scrollback/launch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ M.launch = function()
p.bufid = vim.api.nvim_create_buf(true, true)
vim.api.nvim_set_current_buf(p.bufid)
end
vim.api.nvim_set_option_value('swapfile', false, { buf = p.bufid })
p.winid = vim.api.nvim_get_current_win()

ksb_autocmds.load_autocmds()
Expand Down
7 changes: 3 additions & 4 deletions lua/kitty-scrollback/windows.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ M.open_paste_window = function(start_insert)
p.paste_bufid = vim.api.nvim_create_buf(false, false)
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,
})
vim.api.nvim_set_option_value('filetype', ft, { buf = p.paste_bufid })
vim.api.nvim_set_option_value('swapfile', false, { buf = p.paste_bufid })
ksb_keymaps.set_buffer_local_keymaps(p.paste_bufid)
end
if not p.paste_winid or vim.fn.win_id2win(p.paste_winid) == 0 then
Expand Down Expand Up @@ -164,7 +163,7 @@ M.show_status_window = function()
border = 'none',
}
end

vim.api.nvim_set_option_value('swapfile', false, { buf = popup_bufid })
local popup_winid = vim.api.nvim_open_win(
popup_bufid,
false,
Expand Down

0 comments on commit 772acac

Please sign in to comment.