Bug #17416 2010-08-05 11:17

drakesoft

Auto completion wont work correctly for switch

I get his output if I usw Auto completion with switch():

switch ()\n{\n\tcase :\n\t\tbreak;\n\n\tdefault:\n\t\tbreak;\n}\n

Category
Application::Editor
Group
 
Status
Closed
Close date
2010-10-22 02:36
Assigned to
loaden
ollydbg 2010-08-07 08:46

Can you give more details? I can't understand your problem...

drakesoft 2010-08-07 16:11
If I use "auto completion" (CTRL-J) with switch(), codeblock write this in the same line "switch ()\n{\n\tcase :\n\t\tbreak;\n\n\tdefault:\n\t\tbreak;\n}\n", but codeblocks should write a formated switch() instruction, like this:
switch ()
{
    case :
        break;
        
    default:
        break;
}
I use the codeblocks version "SVN 6435" from the ubuntu PPA:SIMGER
ID_57294 2010-08-20 18:21

I too have this problem, however, it is for all Auto-completions (Ctrl-J).

I've stepped through the code in cbEditor::AutoComplete() and there seems to be a problem with:

code.Replace(_T("\n"), _T('\n') + lineIndent);

The contents of 'code' remain unchanged after execution. Is this the correct place to be looking?

TDM2-gcc 4.4.1 - wxWidgets 2.8.11

ID_57294 2010-08-20 18:26

Complete version info: "svn build rev 6502 (2010-08-20 06:00:37) gcc 4.4.1 Windows/unicode - 32 bit"

loaden 2010-10-20 06:06

Could you trying http://forums.codeblocks.org/index.php/topic,13463.0.html and feedback to me?

Thanks!

It seems solved in cc branch.

loaden 2010-10-22 02:36

This bug is now fixed in HEAD.

Thank you for reporting it.

drakesoft 2010-10-22 06:37

Thank you for fixing this bug and for activ development on codeblocks. Its a realy cool IDE. :-)