-
Notifications
You must be signed in to change notification settings - Fork 53
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
Add option to share Magma between buffers #106
base: main
Are you sure you want to change the base?
Conversation
Initialize magma as usual: `:MagmaInit` or `:MagmaInit kernel_name` Change buffer in neovim and use shared option: `:MagmaInit kernel_name shared` TODO: Improve argument parsing for :MagmaInit Now, the same kernel is shared between two buffers
This is POC for #105
|
@phcerdan What do you mean by this? I'd love to have this feature as well, so I'm happy to put some work in to get it over the finish line. Although it will probably end up just living in my fork instead of getting into this upstream at the moment |
Probably your fork will become the main, @WhiteBlackGoose doesn't seem to have to the time? This PR is working, but I requires some love on how to pass the MagmaInit right now allows 0 or 1 arguments. This PR introduces that if there are at least 2 arguments, @pynvim.command("MagmaInit", nargs="*", sync=True, complete='file') # type: ignore
@nvimui # type: ignore
def command_init(self, args: List[str]) -> None:
self._initialize_if_necessary()
if args:
args = args[0].split(" ")
kernel_name = args[0]
shared = False
if len(args) > 1:
shared = True
print(args) That argument logic has to be improved. That is the only missing part from WIP to ready IMO. |
Unfortunately this PR doesn't handle It's like a 4 line change if we don't expand the functionality to allow loading into the same kernel. 👀 it looks like it might be really easy to do I regret saying that |
Preliminary PR is up: benlubas/molten-nvim#4 I got save and load to a point where it seems like they would work, None-the-less, @phcerdan, if you're able to test that branch that'd be awesome. Don't feel obligated, I'm going to be using it as well, so hopefully it can be merged. Update, it's merged, and Molten is now stable |
Initialize magma as usual:
:MagmaInit
or:MagmaInit kernel_name
Change buffer in neovim and use shared option:
:MagmaInit kernel_name shared
TODO: Improve argument parsing for :MagmaInit
Now, the same kernel is shared between two buffers
Fix #105