-
Notifications
You must be signed in to change notification settings - Fork 17
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
Give plugin authors an "on_close" callback to use when we close down their buffer #1
Comments
I'd like to work on this |
How would I be notified of a specific window closing? |
Hey! I think the best way would probably add an autocmd on/before window close for the window that calls a lua function that was registered at startup. |
Ah, didn't think of that. Few questions about the implementation -
|
Additionally, should the callback be a vimscript function or a lua function? |
Lua functions and vim script functions are interchangeable, so that parts fine :) Yes, autocommands are added with I think If that doesn't make sense, I can explain more later 😄 |
It does make sense, thanks. I read the vim popup api docs, and one of the options is a callback as you said, so that's fine |
From the vim popup api docs, it seems that the callback works this way -
|
I haven't read the docs in a bit for this, but yeah, if you wanted to start implementing the features needed to eventually get I want this to be basically the exact end result of the vim api. I can take a deeper look if you need some help on the issue or want some guidance. Just let me know. |
Oh, I forgot to mention some items may require PRs sent to neovim core. I'd be happy to guide you or help out there. |
Any ideas on how to implement fun Filter(char) abort
if a:char=='a'
echo a:char
return v:true
endif
return v:false
endf
fun Wrapper(char) abort
let l:captured = Filter(a:char)
if !l:captured
return a:char
endif
endf
for i in range(97,122)
exe 'map <expr> '.nr2char(i).' Wrapper("'.nr2char(i).'")'
endfor |
@tjdevries could you take a look at this when you're free? I'm a little busy rn but I will get back to it. Just let me know what you think of this, and if there's a better way to handle the keystrokes |
This would prevent a lot of pain that I have experienced recently.
The text was updated successfully, but these errors were encountered: