cocopon/vaffle.vim

Doesn't restores alternate buffer properly

Opened this issue · 0 comments

By skimming though the code I've found that Vaffle is able to restore alternate buffer. So if I open file A then B, and then open Vaffle to file C, I could use <c-^> to jump to alternate file, in this case, I will be able to jump from file C to file B.

But the above behaviour doesn't work in the following cases:

  • Using command Vaffle % on file B and pressing enter in Vaffle buffer. This opens file B again which is expected, but removes file A (alternate file buffer).
  • Using q in Vaffle quits it but using <c-^> restores Vaffle window rather file A (which is the actual alternate file).

Details:

  • OS: Ubuntu 20.04 via WSL on Windows 10
  • Vim: NVIM v0.5.0-dev+1233-g82ac44d01
  • Minimal .vimrc:
let g:vaffle_show_hidden_files = 1
let g:vaffle_force_delete = 1
nnoremap - <cmd>execute "try \n Vaffle % \n catch \n Vaffle \n endtry"<cr>

function! s:customize_vaffle_mappings() abort
  " go to project root
  nmap <buffer> -        <cmd>Vaffle<cr>
  nmap <buffer> <tab>        <Plug>(vaffle-toggle-current)
  vmap <buffer> <tab>        <Plug>(vaffle-toggle-current)
endfunction

augroup vimrc_vaffle
  autocmd!
  autocmd FileType vaffle call s:customize_vaffle_mappings()
augroup END