-
-
Notifications
You must be signed in to change notification settings - Fork 48
fix: don't expect buffer to be loaded to add it to context #115
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
Conversation
|
ohh, neat! Thanks for fixing this. Do you think we could/should remove the is_loaded check entirely? I wrote that a while ago and very well could have been wrong. |
|
@NickvanDyke I'm not a big opencode specialist yet, so I'm not exactly sure when opencode.nvim should really expect file to be opened in NeoVim. E.g. I'm not yet sure in which cases opencode asks permission to edit a file, and when it just edits without asking anything. Also, if we expect opencode.nvim to run some commands in opened buffers, then maybe it should check if they are loaded right before running those commands. But, in most cases this happens BEFORE sending commands to opencode. So, once opencode will try to do some changes to files, their respective buffers could have already been closed. So, even though there is this "is_loaded" check, it's not very bulletproof, and can easily break in some cases. So probably it can be removed. |
|
@NickvanDyke ALSO, AFAIK quickfix entries have their own kind of buffer objects for every item in a list. We can get some info from them, but at the same time, they don't have to be loaded/opened. |
|
I think the concept of "loaded" is only relevant in Neovim -
So from that perspective, |
|
So if that makes sense, let's change your PR to just removing the |
|
@NickvanDyke So.. Two remaining places where I've tested things and everything seem to work fine. But I would be glad for some additional testing, as I'm clearly not that familiar with the plugin. upd: the case you described with the "last valid buffer" seems to work fine! E.g. I can spawn |
|
Tyvm! |
I am using a quickfix list in a following way:
mkey@quickfixcontext aliasThe issue: currently
opencode.nvimexpects those buffers to be loaded. Which is not guaranteed with such workflow. Here I try to retain this check in other scenarios, but I've removed it from the one which is used by a quickfix.I hope I've explained it clearly!