SUSTech-data / neopyter

The bridge between Neovim and Jupyterlab
BSD 3-Clause "New" or "Revised" License
80 stars 0 forks source link

Neovim hangs when inserting text into a synced file #6

Open aaronmlevy opened 3 months ago

aaronmlevy commented 3 months ago

The response on the browser is nearly instant when scrolling in normal mode on neovim. Also, in normal mode, neovim responds nearly instantly.

But when adding text, i.e., in insert mode, neovim hangs. This is true when I use neopyter both in direct mode and in proxy mode.

Perhaps I'm doing something wrong. This plugin would be ideal if I could manage to fix this problem.

aaronmlevy commented 3 months ago

It looks like the issue occurs when I have .ju.py file that contains content before I open neovim.

If the pattern is supposed to be that you edit one file

file.ju.py,

which syncs with another

file.ipynb,

then I find that neovim hangs.

aaronmlevy commented 3 months ago

I have a couple of questions related to syncing:

1). If I have a file a.py that I would like to sync to b.ipynb, is there a way to do it manually without forcing every other .ju.py file to sync? For context, such a command would constitute a workaround to the above issue. Ideally, though, I would like to be able to open a file a.ju.py with content and have it sync to another file, possibly with different content a.ipynb, without hanging Neovim.

2). Assume a.ju.py is synced with a.ipynb. Sometimes, if I accidentally delete something or modify content in Jupyter Lab, a.ipynb no longer reflects the contents of a.ju.py. Is there a way to refresh the sync without breaking things?

Thank you. This is a very cool package.

AbaoFromCUG commented 3 months ago

Explaination

In normal status, when you open a a.ju.py file, neopyter try to sync with a.ipynb, If a.ipynb which don't exists, it do nothing.

Some tooltips