Skip to content

Commit

Permalink
Disable swapfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Shatur committed Jun 27, 2023
1 parent d7a5e3d commit 5182726
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/session_manager/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,14 @@ function utils.load_session(filename, discard_current)
end
vim.api.nvim_buf_delete(current_buffer, { force = true })

local swapfile = vim.o.swapfile
vim.o.swapfile = false
utils.is_session = true
vim.api.nvim_exec_autocmds('User', { pattern = 'SessionLoadPre' })
vim.api.nvim_command('silent source ' .. filename)
vim.api.nvim_exec_autocmds('User', { pattern = 'SessionLoadPost' })
close_unused_lsp_clients()
vim.o.swapfile = swapfile
end)
end

Expand Down

0 comments on commit 5182726

Please sign in to comment.