Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Bug of code formatter about line warpping
icon11.gif  Bug of code formatter about line warpping [message #1392379] Wed, 02 July 2014 08:42
Yu Chen is currently offline Yu ChenFriend
Messages: 5
Registered: December 2013
Junior Member
It seems the forum does not support spaces and tabs at the beginning of line, so I use dots to replace the spaces.

It occurs when the arguments are marcos. For example,

void fun(int a, int b){
}

int main()
{
....int THIS_IS_A_LONG_NAME_FOR_TEST_THE_WRAPING;
....fun(THIS_IS_A_LONG_NAME_FOR_TEST_THE_WRAPING, THIS_IS_A_LONG_NAME_FOR_TEST_THE_WRAPING);
}

The code formatter works well and the code would be formatted as

void fun(int a, int b){
}

int main()
{
....int THIS_IS_A_LONG_NAME_FOR_TEST_THE_WRAPING;
....fun(THIS_IS_A_LONG_NAME_FOR_TEST_THE_WRAPING,
............THIS_IS_A_LONG_NAME_FOR_TEST_THE_WRAPING);
}

However, if the code is

void fun(int a, int b){
}

#define THIS_IS_A_LONG_NAME_FOR_TEST_THE_WRAPING c

int main()
{
....int c;
....fun(THIS_IS_A_LONG_NAME_FOR_TEST_THE_WRAPING, THIS_IS_A_LONG_NAME_FOR_TEST_THE_WRAPING);
}

After calling coder formatter twice(Use Ctrl+Shift+F for twice), the code would be formatted as

void fun(int a, int b){
}

#define THIS_IS_A_LONG_NAME_FOR_TEST_THE_WRAPING c

int main()
{
....int c;
....fun(THIS_IS_A_LONG_NAME_FOR_TEST_THE_WRAPING,
....THIS_IS_A_LONG_NAME_FOR_TEST_THE_WRAPING);
}

without the two tabs of indent.

[Updated on: Wed, 02 July 2014 08:45]

Report message to a moderator

Previous Topic:make: *** [ ] Error 1
Next Topic:Unable to install CDT in Eclipse Luna for JavaEE developers
Goto Forum:
  


Current Time: Wed Dec 17 21:37:58 GMT 2014

Powered by FUDForum. Page generated in 0.01869 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software