vim-anyfold icon indicating copy to clipboard operation
vim-anyfold copied to clipboard

GitGutter Preview throws error in neovim when vim-anyfold is used

Open vinay0410 opened this issue 4 years ago • 1 comments

I am using vim-anyfold with GitGutter plugin. :GitGutterPreviewHunk opens a pop window to view changes. But when autocmd Filetype * AnyFoldActivate is present in my vimrc, it throws the following error:

Error detected while processing function gitgutter#hunk#preview[3]..<SNR>153_hunk_op[62]..<SNR>153_preview[6]..<SNR>153_populate_hunk_preview_window:
line   14:
E16: Invalid range:       call nvim_win_set_height(s:winid, height)
line   18:
E16: Invalid range:       call nvim_buf_set_lines(winbufnr(s:winid), 0, -1, v:false, [])
line   19:
E16: Invalid range:       call nvim_buf_set_lines(winbufnr(s:winid), 0, -1, v:false, a:body)
line   20:
E16: Invalid range:       call nvim_buf_set_option(winbufnr(s:winid), 'modified', v:false)
line   23:
E16: Invalid range:       call nvim_buf_clear_namespace(winbufnr(s:winid), ns_id, 0, -1)
Error detected while processing function gitgutter#hunk#preview[3]..<SNR>153_hunk_op[62]..<SNR>153_preview[6]..<SNR>153_populate_hunk_preview_window[24]..gitgutter#diff_highlight#process:
line   21:
E16: Invalid range:     call s:diff(rline, aline, i, i+removed, 0, 0, regions, 1)
Error detected while processing function gitgutter#hunk#preview[3]..<SNR>153_hunk_op[62]..<SNR>153_preview[6]..<SNR>153_populate_hunk_preview_window:
line   29:
E16: Invalid range:       call nvim_win_set_cursor(s:winid, [1,0])
Error detected while processing function gitgutter#hunk#preview[3]..<SNR>153_hunk_op[62]..<SNR>153_preview:
line    7:
E16: Invalid range:   call s:enable_staging_from_hunk_preview_window()

I understand that this is also related to GitGutter, but I just wanted to confirm if vim-anyfold does anything which might cause issue when opening pop-up windos in neovim v0.4.4

vinay0410 avatar Aug 25 '20 11:08 vinay0410

It is known that autocmd Filetype * AnyFoldActivate may conflict with buffers managed by other plugins and should not be used. Instead, activate anyfold for specific filetypes only. I leave this issue open to remind myself that I should document this in the readme.

pseewald avatar Aug 25 '20 21:08 pseewald