Posted 19 years ago
by Karl Grambow
I'm handling the SmartIndent event and traversing (backwards) through the previous line to see if I find any matching tokens. I then check to see whether they are BracketHighlighted and do some other stuff based on whether I can find their matching token.
My problem is this, if the matching token is not the last token before the line-end, it's BracketHighlighting value shows up as false, even though it is highlighted.
Here's some of my code to illustrate the problem:So, it looks like, even though oToken is the same in both cases, IsHighlightedBracket is not returning true when the supplied oToken should be being tracked.
I'm obviously doing something wrong or mis-interpreting how BracketHighlighting works but I can't figure out what. Any help is appreciated.
Karl
My problem is this, if the matching token is not the last token before the line-end, it's BracketHighlighting value shows up as false, even though it is highlighted.
Here's some of my code to illustrate the problem:
oToken = oStream.ReadReverse
'read the tokens along the currentline
Do Until oToken.Key = "LineTerminatorToken"
'if we find a begintran token, get out
If oToken.Key = "BeginToken" Then Exit Do
oToken = oStream.ReadReverse
Loop
'below returns true if the line being traversed reads (ignore quotes): "begin tran"
'below returns false if the line being traversed reads (ignore quotes): "begin tran fred"
'however, in both cases oToken.Key = "BeginToken"
If editor.SelectedView.BracketHighlighting.IsHighlightedBracket(oToken) Then
'do some stuff
End If
I'm obviously doing something wrong or mis-interpreting how BracketHighlighting works but I can't figure out what. Any help is appreciated.
Karl