Chris Colman wrote:
Before closing the form holding the method's source we perform a
"matching braces check" to make sure that all opened curly braces
are
closed properly. We use the matching brace methods in scintilla to
do
this but occasionally it incorrectly says that the braces are
unmatched
when in fact they are matched - which prevents the user committing
the
changes to the method.
Brackets within strings and comments may have no match so should
not
be checked, only brackets in the operator style. To be able to
differentiate styles, all the text has to be styled by calling
SCI_COLOURISE.
The text in the editor is colourized correctly for Java or C++ as
appropriate. Maybe my algorithm is flawed: I go to the bottom of the
text then move backward to the first '}' I find. Then I try to find a
match for that. If that succeeds then I go to the beginning of the text
and find the first '{' then I try to match that. If that also succeeds
then I know curly bracket matching is complete.
In case you missed it, I think Neil was saying to use the *style*
bytes too - this would prevent a spurious "match" on a brace char in a
string (e.g.).
Robert Roessler
[EMAIL PROTECTED]
http://www.rftp.com
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest