mathworks / jupyter-matlab-proxy

MATLAB Integration for Jupyter enables you to run MATLAB code in Jupyter Notebooks and other Jupyter environments. You can also open MATLAB in a browser directly from your Jupyter environment to use more MATLAB features.
Other
283 stars 36 forks source link

Support shortcut to un-comment a line #42

Closed tylerlekang closed 3 months ago

tylerlekang commented 1 year ago

System: Windows 10 Matlab 2023a Python 3.8.16 (via Miniconda) Jupyter Lab 3.6.3 (via conda install)

ISSUE: Using Ctrl+/ works fine to comment lines of code (insert % in front of code lines), but when I keep pressing this shortcut it does not remove the comment, and instead just continuously keeps adding them.

Attempts to resolve: I looked in the advanced/JSON keyboard shortcut editor, but there aren't even any listed for commenting code lines. (I'm wondering if this means some of the shortcuts are more integral to the program and thus not editable?)

tylerlekang commented 1 year ago

Note: I realized this could be an issue with Jupyter Lab (on Windows), but on my same machine when using Notebooks with Python (in VS Code) there is no issue with the uncommenting. Also just checked real quick within JL itself using Python, and no problems with uncommenting there as well.

philipc-mw commented 1 year ago

Thank you for trying out the MATLAB Integration for Jupyter, and thank you for the detailed issue report!

Unfortunately this line uncommenting shortcut is not a feature we currently support in this environment. I've reported this usecase to the development teams, and we will consider making this enhancement in a future version of the product. Thank you!

tylerlekang commented 1 year ago

@philipc-mw Thanks for the comment!

For what it is worth (as I mentioned in https://github.com/mathworks/jupyter-matlab-proxy/issues/41 ), this is not an issue when building/editing a MATLAB notebook in VS Code (method for manually setting that up is given in the linked issue).

There, the Ctrl+/ keyboard shortcut will "intelligently" comment and uncomment lines of code with the same shortcut, as when building/editing Python notebooks.

tylerlekang commented 8 months ago

Hi @philipc-mw @prabhakk-mw is there any update on this for use in JL 4? Ideally it would be able to be set to 'ctrl + /' for both commenting and uncommenting (intelligently sensed). Thanks!

prabhakk-mw commented 3 months ago

Hi @tylerlekang

Support for the Ctrl+/ shortcut to comment/uncomment a line has been introduced in v0.13.0 of jupyter-matlab-proxy.

I am marking this issue as closed, kindly do let us know if v0.13.0 works as expected for you as well.

Thanks!