fixed bufdo: restore previous view as well

This commit is contained in:
kdav5758
2021-07-01 23:56:33 -05:00
parent 93c6476c1d
commit 89f29f9774

View File

@@ -5,9 +5,16 @@ local api = vim.api
api.nvim_exec(
[[
function! g:AutoSaveBufDo(command)
let b:autosave_view_before_bufdo = winsaveview()
let currBuff=bufnr("%")
execute 'bufdo ' . a:command
execute 'buffer ' . currBuff
call winrestview(b:autosave_view_before_bufdo)
unlet b:autosave_view_before_bufdo
endfunction
com! -nargs=+ -complete=command Bufdo call BufDo(<q-args>)
]],