Small bug with autocomplete window |
Post Reply |
Author | |
peerschindel
Groupie Joined: 12 July 2008 Status: Offline Points: 11 |
Post Options
Thanks(0)
Posted: 21 April 2009 at 6:14am |
Hello Syntax Edit team,
There's a small bug in autocomplete window.
The function "CXTPSyntaxEditAutoCompleteWnd::Show"
does NOT set the member variable "m_bHighLight".
This means it's random whether the first line of the list in auto-complete-window
is selected when opening the list or not. (Actually it depends how the auto-complete-window
was closed the previous time: With a selection because the last typed character was for
a string in the list or not).
What makes it even more random is the fact, that the member variable "m_bHighLight"
is NOT initialized at all in the constructor of "CXTPSyntaxEditAutoCompleteWnd".
(So the very first time it's totally random and can be e.g. different in Debug and Release).
Here my proposal for a bug fix in file "XTPSyntaxEditAutoCompleteWnd.cpp"
in function "CXTPSyntaxEditAutoCompleteWnd::Show" ca. in line 143:
Replace:
...
int nSearch = Search(strSearch);
m_nHighLightLine = nSearch; ScrollTo(nSearch); ... with
...
int nSearch = Search(strSearch);
m_nHighLightLine = nSearch; // 21.04.09, initialize "m_bHighLight" when showing auto complete window
// so that it's not random any more if something is highlighted when opening it or not
m_bHighLight = m_nHighLightLine >= 0 ; ScrollTo(nSearch); ... Best regards
P.S.:
I really don't know how the people could use the ActiveX variant without the possibility
to inspect/modify the source code...
I just want to make a proposal for the following effect (what - I think - is a bug). |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Thanks, I will check this proposal and update SVN after.
BTW - flag m_bHighLight set to TRUE in All Mouse Button Handlers according to HitTest and also inside CXTPSyntaxEditAutoCompleteWnd::OnKeyDown
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Sorry - don't see differences with and without your changes. Could you make some sample case where we can see such differences in action please?
|
|
peerschindel
Groupie Joined: 12 July 2008 Status: Offline Points: 11 |
Post Options
Thanks(0)
|
Hello,
To reproduce the strange behavior:
1. Open the auto complete list in an empty line. 2. Type a character which is NOT in the list. As result NOTHING is highlighed in the list.
3. Close the autocomplete window (but NOT with the keyboard, but e.g. by clicking somewhere in the view)
So "m_bHighLight" is FALSE from the action in 2. The NEXT time you open the auto complete window (with ...::Show) NOTHING is highlighted in the begining. Now when you do it different:
1. Open the auto complete list in an empty line. 2. Type a character which IS in the list. As result SOMETHING is highlighed in the list.
3. Close the autocomplete window.
So "m_bHighLight" is TRUE from the action in 2. (or 3., if you closed it with a key)
The NEXT time you open the auto complete window (with ...::Show) SOMETHING is highlighted in the begining. Best regards
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Thanks - it really works
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |