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

feat(api): add 'buffer' argument to nvim_get_autocmds #17594

Merged
merged 1 commit into from
Mar 6, 2022

Conversation

gpanders
Copy link
Member

@gpanders gpanders commented Mar 3, 2022

This enables retrieving autocommands defined in the given buffers. Under the hood this simply translates the buffer numbers into <buffer=%d> patterns.

@github-actions github-actions bot added the api libnvim, Nvim RPC API label Mar 3, 2022
@github-actions github-actions bot requested review from bfredl and muniter March 3, 2022 21:05
@gpanders gpanders changed the title api(autocmd): add 'buffer' argument to nvim_get_autocmds feat(api): add 'buffer' argument to nvim_get_autocmds Mar 3, 2022
@gpanders gpanders requested a review from tjdevries March 3, 2022 21:08
@gpanders gpanders force-pushed the get_buf_autocmds branch 2 times, most recently from 5b030e7 to dcdd65a Compare March 3, 2022 21:37
Copy link
Member

@muniter muniter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. But also wonder if we should have some incantation for this API function to get all existing autocommands.

So plugins like telescope don't have to parse the output of verbose autocmd *

@gpanders
Copy link
Member Author

gpanders commented Mar 4, 2022

But also wonder if we should have some incantation for this API function to get all existing autocommands.

Agreed. We should either allow event to be *, or change the semantics so that omitting event means "all events". We can tackle that in a separate PR tho.

This enables retrieving autocommands defined in the given buffers. Under
the hood this simply translates the buffer numbers into '<buffer=%d>'
patterns.
@gpanders gpanders merged commit 92349b1 into neovim:master Mar 6, 2022
@gpanders gpanders deleted the get_buf_autocmds branch March 6, 2022 19:35
dmitmel pushed a commit to dmitmel/neovim that referenced this pull request Apr 16, 2022
This enables retrieving autocommands defined in the given buffers. Under
the hood this simply translates the buffer numbers into '<buffer=%d>'
patterns.
@dundargoc dundargoc removed the request for review from bfredl November 7, 2022 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api libnvim, Nvim RPC API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants