-
Notifications
You must be signed in to change notification settings - Fork 259
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
Fix #570 - Behaviour of ToggleCommentAction #572
base: master
Are you sure you want to change the base?
Fix #570 - Behaviour of ToggleCommentAction #572
Conversation
…ix' into ToggleCommentAction-whitespace-fix # Conflicts: # RSyntaxTextArea/src/main/java/org/fife/ui/rsyntaxtextarea/RSyntaxTextAreaEditorKit.java # RSyntaxTextArea/src/test/java/org/fife/ui/rsyntaxtextarea/RSyntaxTextAreaEditorKitToggleCommentActionTest.java
@sesquialtera87 can you rebase and fix the merge conflicts here? I'd be interested in adding this fix to the next release. |
# Conflicts: # RSyntaxTextArea/src/main/java/org/fife/ui/rsyntaxtextarea/RSyntaxTextAreaEditorKit.java
@sesquialtera87 I hate to ask this, but can you remove all the formatting changes? They're making this PR much larger than it should be and obfuscating the actual change. |
No problem. In the next few days I'll try to restore the formatting and include only the new code, without touching anything else in the code |
…space-fix # Conflicts: # RSyntaxTextArea/src/test/java/org/fife/ui/rsyntaxtextarea/RSyntaxTextAreaEditorKitToggleCommentActionTest.java
Hi @sesquialtera87 ! A new branch is probably the cleanest way to move forward. |
I tried to solve the comment-mark identification by
ToggleCommentAction.
Basically, the use of
startsWith
andendsWith
methods allowed only to search for comment-marks at position 0 andline.length()-1
, not recognizing in this way comments likewhere some whitespaces are present before or after the marks.
Instead of the
startsWith
andendsWith
, I introduced two methods looking for mark by skipping leading or trailing whitespaces. Now de-comment a code like this work as expected (previously another comment would have been inserted)I hope it can be useful