Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

hook "tab" key

<< < (5/6) > >>

MortenMacFly:

--- Quote from: Loaden on March 27, 2010, 12:43:27 am ---We do not have access to ‘event.GetKeyCode()’ value and 'switch’ calculation, BUT, we need call 'AllowTabSmartJump' each time.

--- End quote ---
Yes, but in the other case you do call AllowTabSmartJump() all the time, too - right?! You do it in every case statement.

So - I am not sure what causes more CPU time, really. However, I believe it makes the code easier to understand. But I guess this discussion is based on personal habits - so I accept your decision however it is.

Loaden:
Auto delete ')', when press backspace.

--- Code: ---Index: src/plugins/codecompletion/codecompletion.cpp

===================================================================

--- src/plugins/codecompletion/codecompletion.cpp (revision 6202)

+++ src/plugins/codecompletion/codecompletion.cpp (working copy)

@@ -2014,6 +2014,7 @@

             control->SetTargetStart(start);
             control->SetTargetEnd(pos);
             control->ReplaceTarget(itemText+_T("()"));
+            control->SetTabSmartJump();
             pos = control->GetCurrentPos();
             control->GotoPos(pos + itemText.size()+2);
             if ((*it).second != 0)

--- End code ---

test code:

--- Code: ---#include <stdio.h>

class A
{
public:
    void test()
    {
       
    }
};

int main(int argc, char* argv[])
{
    A a;
    a.test(|) // HERE, when backspace, it's can delete '(', also ')'.
    return 0;
}
--- End code ---

Loaden:
Rewrote this, it's support jump tip now.

EDIT: fix a bug. Welcome for test!

[attachment deleted by admin]

killerbot:
wake up call ;-)
What's the state on this patch, any issues still open, or could we try to apply it ?
Is the patch attached here the same as the one in the berlios tracker, or are they out of sync ?

Loaden:
Hi, killerbot, The patch is applied in cc branch now.
And looks works well.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version