-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[comment.py] Toggle Comment line bug #691
Comments
This issue is not relevant to this repo. As stated in the README:
I would suggest reposting this in SublimeTextIssues/Core, which deals with general bug reports. Make sure to search first to see if it has already been reported. |
This PR proposes to close some already fixed issues, which were not (correctly) referenced in the fixing pull requests. Closes sublimehq#442 Closes sublimehq#685 Closes sublimehq#691 (invalid) Closes sublimehq#795 Closes sublimehq#807 Closes sublimehq#903 Closes sublimehq#1141 Closes sublimehq#1172 Closes sublimehq#1245 Closes sublimehq#1257 Closes sublimehq#1286 Closes sublimehq#1320 Closes sublimehq#1357 Closes sublimehq#1382 (wontfix) Closes sublimehq#1403 Closes sublimehq#1451 Closes sublimehq#1453 (maybe) Closes sublimehq#1472 Closes sublimehq#1495 Closes sublimehq#1540 Closes sublimehq#1542 Closes sublimehq#1565 Closes sublimehq#1576 Closes sublimehq#1625 Closes sublimehq#1880 Closes sublimehq#1898 Closes sublimehq#1940 (invalid)
This appears to not really be a syntax issue, but rather a command issue that is part of the C++ codebase or the Default packages (which is not open source here). A report at https://github.com/SublimeTextIssues/Core would be appropriate, although there may already be one there. |
The toggle comment can sometime behave strangely if there is block comment embedded:
For example, let's take the following code in C (happens with any language with both line and block comment):
If the three lines are selected and the command toggle line comment is called (ctrl+/ by default) then the block comment around 1 is removed. If only two lines are selected then the two line are correctly commented with a // at the beginning of the line.
Looking at the code in comment.py this seems to comes from the way the remove block_block_comment works: it try to extract the scope from the middle of the selection and if the middle is a block comment then it gets toggled ...
I am not sure exactly how to fix this issue properly (apparently it was done this way instead of looking directly at start and beginning of the region to avoid some issue with HTML comment ...), but at least when the toggle comment is called with block to false it should never affect the block comment, so a beginning of a fix is provided here:
The problem still appears when toggle comment is called with block true, but since block comment cannot be embedded one in another, this is less of a concern.
The text was updated successfully, but these errors were encountered: