Skip to content
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

Revert multiline toggle-comment behavior #591

Merged
merged 1 commit into from
Dec 21, 2024

Conversation

bobbylight
Copy link
Owner

@bobbylight bobbylight commented Dec 21, 2024

The prior fix for #570 (f0d8326) accidentally broke behavior when multiple lines are selected. Specifically, in that case we should continue to toggle the "commented out" state for all lines uniformly, based on whether they are all currently commented out or not. This is needed to uniformly comment out blocks of code even if they have line comments in them.

This PR reverts to the prior behavior there, but keeps the prior fix's behavior change for toggling single-line comments (i.e. leading whitespace is ignored in the check). Unit tests have been thoroughly improved to cover all cases.

Copy link

codecov bot commented Dec 21, 2024

Codecov Report

Attention: Patch coverage is 73.33333% with 16 lines in your changes missing coverage. Please review.

Project coverage is 80.40%. Comparing base (f0d8326) to head (947005e).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...e/ui/rsyntaxtextarea/RSyntaxTextAreaEditorKit.java 73.33% 5 Missing and 11 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #591      +/-   ##
============================================
- Coverage     80.40%   80.40%   -0.01%     
+ Complexity     7793     7792       -1     
============================================
  Files           178      178              
  Lines         30261    30261              
  Branches       3914     3913       -1     
============================================
- Hits          24332    24330       -2     
- Misses         4255     4257       +2     
  Partials       1674     1674              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bobbylight bobbylight marked this pull request as ready for review December 21, 2024 21:41
@bobbylight bobbylight self-assigned this Dec 21, 2024
@bobbylight bobbylight added the bug label Dec 21, 2024
@bobbylight bobbylight added this to the 3.5.4 milestone Dec 21, 2024
@bobbylight bobbylight merged commit 8a5d657 into master Dec 21, 2024
5 of 7 checks passed
@bobbylight bobbylight deleted the fix-multiline-toggle-comment-behavior branch December 21, 2024 21:43
@bobbylight
Copy link
Owner Author

This is in the latest 3.5.4-SNAPSHOT on Sonatype.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant