Skip to content
New issue

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

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

Already on GitHub? # to your account

Use event.buf directly to get bufnr #1047

Merged
merged 2 commits into from
Nov 4, 2023
Merged

Conversation

xu-cheng
Copy link
Contributor

@xu-cheng xu-cheng commented Nov 4, 2023

Due to the neovim's issue (neovim/neovim#16416), using vim.fn.expand sometimes throws Keyboard interrupt error when pressing Ctrl-C (a common alternative to Esc).

This works around the above issue by simply getting the buffer number from event argument.

xu-cheng and others added 2 commits November 3, 2023 21:00
Due to the neovim's issue (neovim/neovim#16416),
using `vim.fn.expand` sometimes throws Keyboard interrupt error when
pressing Ctrl-C (a common alternative to Esc).

This works around the above issue by simply getting the buffer number
from event argument.
@L3MON4D3
Copy link
Owner

L3MON4D3 commented Nov 4, 2023

Ahhh of course, thank you!

@L3MON4D3 L3MON4D3 merged commit a4de645 into L3MON4D3:master Nov 4, 2023
@xu-cheng xu-cheng deleted the autocmd-bufn branch November 4, 2023 17:02
xu-cheng added a commit to xu-cheng/LuaSnip that referenced this pull request Nov 20, 2023
We don't need to use `vim.fn.expand(...)` to get the buffer or file for
the autocmd callbacks. Instead, use `event.buf` or `event.file` directly
from the callback function argument.

See also L3MON4D3#1047.
L3MON4D3 pushed a commit that referenced this pull request Nov 20, 2023
We don't need to use `vim.fn.expand(...)` to get the buffer or file for
the autocmd callbacks. Instead, use `event.buf` or `event.file` directly
from the callback function argument.

See also #1047.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants