Closed nyngwang closed 1 year ago
Can remove the hotfix autocmd
in 5e33b29 as long as the upstream issue https://github.com/neovim/neovim/issues/5176 would be resolved by someone. To remove it, simply comment out the following line:
Note: this is pinned because it should be resolved upstream.
Migrated from: https://github.com/nyngwang/NeoZoom.lua/issues/78, since the title has nothing to do with it after the breaking change.
current progress
```lua vim.api.nvim_create_autocmd({ 'TermOpen' }, { group = curfile_augroup, callback = function () local buf_term = vim.api.nvim_get_current_buf() local buf_enter = vim.fn.bufnr('#') vim.api.nvim_set_current_buf(buf_enter) local view_enter = vim.fn.winsaveview() vim.api.nvim_set_current_buf(buf_term) vim.api.nvim_create_autocmd({ 'WinClosed' }, { buffer = buf_term, group = curfile_augroup, callback = function (args) if -- it's another buffer/win being closed. vim.api.nvim_get_current_buf() ~= args.buf or vim.api.nvim_win_get_config(0).relative ~= '' then return end vim.cmd('split') if vim.api.nvim_buf_is_valid(buf_enter) then vim.api.nvim_set_current_buf(buf_enter) vim.fn.winrestview(view_enter) else vim.api.nvim_set_current_buf(vim.api.nvim_create_buf(true, false)) end end, }) end, }) ```