n-riesco / ijavascript

IJavascript is a javascript kernel for the Jupyter notebook
Other
2.18k stars 187 forks source link

Bad code completion in cells with multiple occurances of the text to match #82

Open rgbkrk opened 8 years ago

rgbkrk commented 8 years ago

Rather than the position reported from the frontend. This leads to interesting behavior:

Totally valid: ✅

screen shot 2016-09-17 at 2 32 34 pm

Also valid, deeper in: ✅

screen shot 2016-09-17 at 2 32 20 pm

My cursor is at the bottom, yet it's "completing" on a prior occurence of console: ❌

screen shot 2016-09-17 at 2 32 43 pm
n-riesco commented 8 years ago

It looks to me like a frontend issue. I can't reproduce it with IPython 1.2.1. What frontend version are you using?

rgbkrk commented 8 years ago

This is in nteract.

n-riesco commented 2 years ago

Sorry @rgbkrk , now that I've read your issue again, I get it. Definitely, a bug in ijavascript.

n-riesco commented 2 years ago

$$.html works around the issue https://github.com/n-riesco/nel/blob/9dfd47f15d8be83ee1e313d512a34180c99003c9/lib/nel.js#L932-L1055 https://github.com/n-riesco/nel/blob/9dfd47f15d8be83ee1e313d512a34180c99003c9/lib/nel.js#L1311-L1387