Author Topic: codecomletin problem  (Read 7194 times)

Offline blueshake

  • Regular
  • ***
  • Posts: 459
codecomletin problem
« on: August 27, 2009, 03:56:49 am »
hello,
did anybody find that when the codecompletion is activated and you type "."
then the member list will not show.
see the attachment.
i think this patch will help.
Code
Index: codecompletion.cpp
===================================================================
--- codecompletion.cpp (revision 5744)
+++ codecompletion.cpp (working copy)
@@ -1937,7 +1937,9 @@
 //        Manager::Get()->GetLogManager()->DebugLog(_T("wxEVT_SCI_KEY"));
 //    else if (event.GetEventType() == wxEVT_SCI_MODIFIED)
 //        Manager::Get()->GetLogManager()->DebugLog(_T("wxEVT_SCI_MODIFIED"));
-
+    if (event.GetKey() == '.')
+        if (control->AutoCompActive())
+            control->AutoCompCancel();
     if (event.GetEventType() == wxEVT_SCI_CHARADDED &&
         !control->AutoCompActive()) // not already active autocompletion
     {
any comment will be welcomed

[attachment deleted by admin]
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline blueshake

  • Regular
  • ***
  • Posts: 459
Re: codecomletin problem
« Reply #1 on: August 27, 2009, 11:25:58 am »
let me describle this problem again.
here is the test codes.
Code
#include <iostream>

using namespace std;
class pt
{
    int x;
    int y;
};
int main()
{
    pt pp;
    |
    cout << "Hello world!" << endl;
    return 0;
}

in the "|" position ,you type pp and the codecompletion showed (see the attachment above)
and you continue to type the char "." (notice the codecompletion still show) .
here the class pt's members is excepted to be show.but nothing show here.
so this patch can solve the problem.
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: codecomletin problem
« Reply #2 on: August 27, 2009, 12:14:28 pm »
I have applied this patch in my local copy.

And it works!!!

Thanks! :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.