Make the status buffer a standalone instance #646
ten3roberts
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
Related: #639 |
Beta Was this translation helpful? Give feedback.
0 replies
-
That would be amazing. I did ask about programmatic access long time ago. Would love to be able to call api to commit file and push to remote. Big 👍 from me. Thanks for reviving Neogit! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Wild idea: making the status buffer an owned object, rather than the current global state intertwined singleton it is now.
The API would remain mostly the same, as we would simply store a global of the current instance, rather than multiple global variables.
The advantage of having it this way is that we can pass the instance around to the popups without intrusively
require("neogit.status")
and reaching in from within the popups. This would fix the issues @gegoune were having as you would now have to provide the instance (or create one) rather than crossing your fingers and hoping the correct global state exists and is in a proper state for what you are trying to do.This would also clear up our public API tons, as well as enable a programmatic usage of Neogit by having the exposed API. For example for opening popups opening or committing. These would be methods of, or functions taking a
Status
object, and would further allow you to use the full extents of our library without opening and displaying Neogit status buffer, as you could simply create aStatus
object inLua
and just forego displaying or opening it. I.e; headless operation without missing some part of global state and panicking onattempt to access nil value "current"
Beta Was this translation helpful? Give feedback.
All reactions