I want to make a neovim plugin but my plugin need to be able to copy the whole vim api, do some changes to it and roll back later
backup = vim
-- do some stuff with `vim`
vim = backup
I tried to do it like written above
lua vim.o.number = true
lua backup = vim
lua vim.o.number = false
lua vim = backup
but the line numbers didn’t reappear once I tried to resign vim = backup
I also tried to do
backup = vim.deepcopy(vim)
but it got worst as this time I got an error
E5108: Error executing lua vim/shared.lua:0: Cannot deepcopy object of type userdata
I also tried to read the neovim documentation but didn’t found the information
Because of what I want to do, I have to be able to store a copy of it and to be able to roll back to this copy, and I need to do it multiple times