cocopon / vaffle.vim

:file_folder: Lightweight, window-based file manager for Vim
MIT License
284 stars 20 forks source link

Doesn't restores alternate buffer properly #64

Open ajitid opened 3 years ago

ajitid commented 3 years ago

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:

Details:

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