small BracketHighlighting bug

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by Joris Koster - Paragon Decision Technology
Avatar
When I toggle the BracketHighlightingVisible (both true to false and false to true) while the caret is currently on a bracket, the new BracketHighlighting-mode is not applied on the screen. Only moving the caret, programmaticaly or manualy, causes the BracketHighlight-drawing to be enabled/disabled as specified.

I would like to disable BracketHighlighting whenever the editor doesn't have the focus; so i'm enabling/disabling the bracket highlighting on the Got/Lost focus event. Unfortunately I'm now forced to move the caret back and forth programatically in order to let the redraw occur, but doing so has a nasty side-effect on the intelliprompt memberlist: the edit-ctrl looses focus to the member-list-ctrl upon a mouse-click in the member-list; this causes me to move the caret and thus to cancel the selection. So I ended up checking the visibility of the memberlist during the got/lost focus call before toggling the BracketHighlightingVisible and moving the caret :S.

Could this BrackeHighlighting redraw bug be fixed, or (alternatively for me :)) have an option to enable BracketHighlighting only on focus?

thanks,
Joris

Comments (7)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Good points Joris, I'll add them to the TODO list.


Actipro Software Support

Posted 18 years ago by Dong JIA
Avatar
Has this bug fixed in latest release?
Best regards,
Dong JIA
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
No not yet.


Actipro Software Support

Posted 18 years ago by Dong JIA
Avatar
It is a bad news for me. :(
Posted 18 years ago by Dong JIA
Avatar
Will it be fixed in next Maintenance Release? If yes, it will help me greatly.
I know that moving caret will force BracketHighlighting refresh, but it also brings many troubles.
Moving caret will modify "SelectedView.FirstVisibleDisplayLineIndex" and cause some other issues.
I know you are very busy now. But I really hope that you can put it in your next maintenance release.

BTW, the following code will fail and I am not sure it is a bug:
protected override void OnLostFocus(EventArgs e)
{
base.OnLostFocus(e);
index = SelectedView.FirstVisibleDisplayLineIndex;
BracketHighlightingVisible = false;
// Actipro Syntax Editor has a bug:
// BracketHighlightingVisible only takes effect after changing Caret. :(
int offset = Caret.Offset;
Caret.Offset++;
Caret.Offset = offset;
// I think I has restore the Caret.offset, but SelectedView.FirstVisibleDisplayLineIndex
// has been changed.
// STRANGE!!!!!!!
Debug.Assert(index == SelectedView.FirstVisibleDisplayLineIndex);
}

Waiting your response.
Best regards,
Dong
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Two things have been done for the next maintenance release (should be out next week):

1) Bracket highlighting indicators will now instantly update when the BracketHighlightingVisible property is changed. So no more need to move the caret.

2) Bracket highlights will now only display in a view that has focus. If you switch to another view then the highlights will jump to that one. If the editor loses focus then they will hide. If a view gets focus again, the highlights will reappear in that view. Highlights are associated with the context of the caret so this modified behavior makes sense.

I also tested the code change with displaying a member list and the highlights should no longer flicker when clicking on the member list.


Actipro Software Support

Posted 18 years ago by Joris Koster - Paragon Decision Technology
Avatar
Great! thanks!
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.