if ( control->IsString(style)
|| control->IsComment(style)
|| control->IsCharacter(style)
|| control->IsPreprocessor(style) )
{
return;
}
// this
...So it looks like the code for IsComment() may be a bit buggy.I agree with you, you can report to scintilla :).
IsComment(style) is part of cbStyledTextCtrl not scintilla!The problem is the control->GetStyleAt() function, that always returns 0 as style for the last position of a document.
IsComment(style) is part of cbStyledTextCtrl not scintilla!The problem is the control->GetStyleAt() function, that always returns 0 as style for the last position of a document.
And that's a Scintilla issue.
Any comments ?IsComment(style) is part of cbStyledTextCtrl not scintilla!The problem is the control->GetStyleAt() function, that always returns 0 as style for the last position of a document.
And that's a Scintilla issue.
Maybe not an issue, because the last postion is not styled at all, so retuzrning a zero.style might be considered the correct way to handle it.
I attach a patch with a quick (and more or less ugly) fix for this.
If the caret is on last position of a document (with length > 0) we use the style for the last character.
Any comments ?No, seems to work here - at lest I see not negative side-effects.