X Tutup
Skip to content

s:WinSaveViews() is not compatible with Vim 8.1 #383

@ppetr

Description

@ppetr

The first issue I encountered was that the older version of bufnr() requires an argument. This can be fixed easily by

diff --git a/plugin/autoformat.vim b/plugin/autoformat.vim
index 2cccb7a..a743711 100644
--- a/plugin/autoformat.vim
+++ b/plugin/autoformat.vim
@@ -217,7 +217,7 @@ endfunction

 function! s:WinSaveViews()
     let s:views = {}
-    for winid in win_findbuf(bufnr())
+    for winid in win_findbuf(bufnr('%'))
         call win_execute(winid, 'let s:views[winid] = winsaveview()')
     endfor
 endfunction

But then it turns out win_execute() is not available at all in Vim 8.1, and I don't know what would be the correct way to work around this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup