mirror of
https://github.com/zoriya/auto-save.nvim.git
synced 2025-12-06 06:36:11 +00:00
fixed bufdo: restore previous view as well
This commit is contained in:
@@ -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>)
|
||||
]],
|
||||
|
||||
Reference in New Issue
Block a user