Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: expand autocmd with <abuf> is wrong for BufUnload #58

Open
chemzqm opened this issue May 4, 2018 · 1 comment
Open

Bug: expand autocmd with <abuf> is wrong for BufUnload #58

chemzqm opened this issue May 4, 2018 · 1 comment
Labels

Comments

@chemzqm
Copy link
Contributor

chemzqm commented May 4, 2018

  @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.

@chemzqm chemzqm changed the title Bug: expand autocmd buffer number always wrong Bug: expand autocmd buffer number somethimes wrong May 4, 2018
@chemzqm chemzqm changed the title Bug: expand autocmd buffer number somethimes wrong Bug: expand autocmd with <abuf> is wrong for BufUnload May 7, 2018
@chemzqm
Copy link
Contributor Author

chemzqm commented May 9, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants