If we have not selected, in SVN6204 version, CB will comment current line.
But we can do it use Box-comment too.
In many cases, we only need one word comment.
Example:
void OnKeyUp(wxKeyEvent& /*evt*/)
{
}
Index: src/src/main.cpp
===================================================================
--- src/src/main.cpp (revision 6204)
+++ src/src/main.cpp (working copy)
@@ -3287,9 +3287,13 @@
{
int startPos = stc->GetSelectionStart();
int endPos = stc->GetSelectionEnd();
- if ( startPos == endPos ) { // if nothing selected stream comment current line
- startPos = stc->PositionFromLine (stc->LineFromPosition(startPos));
- endPos = stc->GetLineEndPosition(stc->LineFromPosition(startPos));
+ if ( startPos == endPos ) { // if nothing selected stream comment current *word* first
+ startPos = stc->WordStartPosition(stc->GetCurrentPos(), true);
+ endPos = stc->WordEndPosition (stc->GetCurrentPos(), true);
+ if ( startPos == endPos ) { // if nothing selected stream comment current line
+ startPos = stc->PositionFromLine (stc->LineFromPosition(startPos));
+ endPos = stc->GetLineEndPosition(stc->LineFromPosition(startPos));
+ }
}
else {
/**
[attachment deleted by admin]