mathworks / MATLAB-extension-for-vscode

This extension provides support for editing MATLAB® code in Visual Studio® Code and includes features such as syntax highlighting, code analysis, navigation support, and more.
https://marketplace.visualstudio.com/items?itemName=MathWorks.language-matlab
MIT License
234 stars 15 forks source link

Toggle block comment (Shift+Alt+A) nests comments instead of toggling #66

Open dklilley opened 11 months ago

dklilley commented 11 months ago

Describe the bug When block comments are toggled using Shift+Alt+A, existing block comments are never removed, only added, effectively nesting the block comments.

To Reproduce Steps to reproduce the behavior:

  1. In a MATLAB file, type x = 1
  2. Select x = 1
  3. Type Shift+Alt+A multiple times

This will result in a structure like the following:

%{
%{
 x = 3 
%}
%}

Expected behavior The first time block comments are toggled, it should insert the block comment. The second time it is toggled, the existing block comment should be removed.

Useful Information