when I using cursor to edit my jupyter notebook, I encountered this problem where the cursor tab does not apply code to the correct position that my cursor at. it would apply code to some random position either above or below the position of my typing position, and the code it applied is also in a cracked style, and the content it generates is also misunderstanding.
don’t know what makes that happen, but it seems that cursor can’t deal with the cell structure in the jupyter notebook. detailed is in this gif, on imgur(file size exceed the limit, cannot upload here) Imgur: The magic of the Internet
below is a compressed gif file, incause you guys dont trust the link, but it is very low dfn.
After some testing I was able to fix my issues by removing some odd or improper uses of mark down. I had some things in code blocks inside numbered lists. I also had a block that was a heading with 6 lines of text following that was double indented over to alter the text color at render time.
After I removed those cells I was able to get it working again.
It took some trial and error but the you can trouble shoot where it is getting hung up by going to View > Output (ctrl + shift + u) then in the selector in the top right of the output panel select cursor tab. you can see what it is outputting here and I was able to test cell by cell and see when it stopped working.
Well I should also add that it improved the issue for me not fully resolved it. I think the point of checking in the output window still stands that can help me get it back on track quicker but there are still some bugs with Cursor Tab in notebooks.
Further testing leads me to believe this is related to having markdown headers collapsed and perhaps leaving the window open for a while without toggling the collapsing of the headers. After removing the, potentially offending, markdown things were better but couldn’t pin down the error but I think I am able to reliably fix the Cursor Tab completion by expanding and collapsing the headers. Things work like normal for some time after that but if cursor is running long enough it will need to be done again.
Windsurf was something I had not heard of, tried it and I will leave it installed but not sure that it is better than Cursor Tab. It might be better for whole project refactoring but I haven’t tried that yet.
Thanks for these posts. I also work mostly with notebooks and have been having issues with cursor tab in these since this July. At the time, I also noticed weird behaviors related to markdown.
After some tests I’ve found that removing superfluous empty lines (and tabs, etc.) reduces cursor tab mistakes/erroneous behavior. I’m able to produce errors in behavior by adding in extra blank lines in my markdown, and fixing this requires restarting the kernel.
I’m now able to get some use out of cursor tab in my notebooks again, which is very nice! I’ll reply with any other behaviors I notice, and hopefully the devs can figure this out soon.