node-client
node-client copied to clipboard
Bug: expand autocmd with <abuf> is wrong for BufUnload
@Autocmd('BufUnload', {
sync: true,
pattern: '*',
eval: 'expand("<abuf>")'
})
public async onBufUnload(bufnr: string):Promise<void> {
logger.debug(`file: ${bufnr} remove`)
}
The bufnr
here is always the buffer number of current buffer number, but it should be the buffer number of removed buffer.
autocmd BufUnload * call s:OnUnload()
function! s:OnUnload()
echo +expand('<abuf>')
endfunction
vim script doesn't have this problem.
BTW: <afile>
is neither correct.
I've changed to use latest master branch. Issue still exists, but it only occurs when delete hidden buffer, the buffer number would always be current buffer number.