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

Support autocmd once #47

Open
zchee opened this issue May 6, 2019 · 8 comments
Open

Support autocmd once #47

zchee opened this issue May 6, 2019 · 8 comments

Comments

@zchee
Copy link
Member

zchee commented May 6, 2019

Currently, there is no Once field on AutocmdOptions.

type AutocmdOptions struct {

But not works even if adding that field (on local env)
I think should be support and change nvim core runtime/autoload/remote/define.vim.

https://github.com/neovim/neovim/blob/2a3bcd1ff883429a3dd17e7ae5ddc1396abbad17/runtime/autoload/remote/define.vim#L228

@zchee
Copy link
Member Author

zchee commented May 6, 2019

/cc @justinmk
My Interpretation is correct?

@zchee zchee added the area/nvim label May 6, 2019
@justinmk
Copy link
Member

justinmk commented May 7, 2019

@zchee sure we could enhance remote/define.vim. But AFAIK remote/define.vim already manages autocmds as needed, so I don't know what the "once" feature would be used for. Does go-client have an API for defining generic autocmds?

@zchee
Copy link
Member Author

zchee commented May 7, 2019

@justinmk
I will more detail comment later.

@zchee
Copy link
Member Author

zchee commented May 7, 2019

Just in case,

But AFAIK remote/define.vim already manages autocmds as needed

I said once feature means ++once arg on autocmd.
neovim/neovim@3259e45

The garyburd styles remote#host#Register usage for Go plugin is depends runtime/autoload/remote/host.vim.

Anyway, will comment later.

@justinmk
Copy link
Member

justinmk commented May 7, 2019

I said once feature means ++once arg on autocmd.

Understood. But I don't see what it would be used for.

@zchee
Copy link
Member Author

zchee commented May 7, 2019

Just for confirm, in case of vim script, when register some func to CursorMoved autocmd with ++once, that func will called when only of first CursorMoved event, right?

@mhinz
Copy link
Member

mhinz commented May 7, 2019

Yup, the autocmd gets removed after its first usage.

@zchee
Copy link
Member Author

zchee commented May 7, 2019

@mhinz
Thanks, so describe to how to use in Go with pseudo code later.

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

No branches or pull requests

3 participants