WolframResearch / WolframLanguageForJupyter

Wolfram Language kernel for Jupyter notebooks
MIT License
1.05k stars 126 forks source link

Add rewrites for named character names (to named characters) #51

Closed cc-wr closed 5 years ago

cc-wr commented 5 years ago

This implements a feature request brought up in #45.

This pull request allows one to type the vertical ellipsis character, and then all or part of a named character name or shortcut: tab-completion should then show possible named characters that could complete said name or shortcut.

NOTE: To type the vertical ellipsis character, place the javascript file at extras/custom.js in a special location according to your platform (e.g., ~/.jupyter/custom/custom.js). See also https://stackoverflow.com/a/39921293.

The code will then redirect all keypresses of the escape character (Esc) to the vertical ellipsis character, in all Jupyter notebooks, irrespective of the kernel type.

vsht commented 5 years ago

The custom.js file gets loaded correctly (I added an alert("hello world from custom.js") to be sure), but it looks like the redirection of Esc to the vertical ellipsis character doesn't work. I tried Firefox and Chromiun and in both cases pressing Esc still switches between the edit mode and command mode.

cc-wr commented 5 years ago

@vsht, to help me diagnose the problem, can you give me a jupyter notebook version (with something like jupyter notebook --version), a Firefox browser version, and a platform version?

cc-wr commented 5 years ago

@vsht, I will go ahead with the next steps for merging this.

I will create a new pull request with additional fixes when you respond to the above.

vsht commented 5 years ago

I'm terribly sorry, somehow I completely forgot about this issue. The jupyter notebook version is 5.7.8, the Firefox version is 68.0. By the platform version do you mean the OS? It's Fedora Linux 30 64-bit.

cc-wr commented 5 years ago

Is the issue resolved with this most recent commit?

vsht commented 5 years ago

Yes! Now it is working as expected. Thanks a lot, this really makes the user experience much more pleasant!

Keyboard input for subscripts and superscripts would be another nice thing to have, but this is not really something urgent.