Hi,
I am using Clodeblock 16.01 on Ubuntu 14.04 LTS x64.
For a special printable view of my prof I need to make my Code to have no lines with more thant 80 characters.
When right clicking of the code and chosing "Format use AStyle" its doing well except for some few hundred lines (out of thousands).
I still activated the "Enable line breaking" Checkbox und
Settings ->Editor -> Source formatter -> Formatting
and set the value from 200 to 50 or 80.
But nothing happend.
Also when rerunning "Format use AStyle" its still the same output as before, there still are lines with more thant 80 characters.
I also tried using the other checkbos "break logical condionals..." with not other result.
(after reopening the settings, this second checkbox always is greyed out until I uncheck and recheck the first checkbos ("Enable line breaking"))
Is there an other way to configure Astyle that way?
Or to get the option "Enable line breaking" working?
Sample of such a line not beeing wrapped:
std::pair <std::multimap<int, std::tuple<int, double>>::iterator, std::multimap<int, std::tuple<int, double>>::iterator>
revXTRangeBoundsIter;
Thanks in advance.
Hi, i tested this on windows and the line breaking works for me:
Set line length to 80, mark all text and left click->Format use astyle
i have found out, that you have to select all text to work, it does not work if you select only a part of the text...
You have to consider a view things:
1) AStyle can only break a line if there is a possibility to break (a empty space, or a apostrophe) : it can't break long names for example
2) It does not break comments
3) If you have deep contexts (like multiple if) it also can't break, because the indentation is stronger, so at the end there is no space left to break
I also tried using the other checkbos "break logical condionals..." with not other result.
This works also as expected:
From this code:
if(hellsadfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfo && teasdfasdfasdfasdfasdfasdfasdfasdfasdfst && blaasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfbla)
{
asdlalsdk;
}
if disabled:
if(hellsadfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfo
&& teasdfasdfasdfasdfasdfasdfasdfasdfasdfst
&& blaasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfbla)
{
asdlalsdk;
}
if enabled:
if(hellsadfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfo &&
teasdfasdfasdfasdfasdfasdfasdfasdfasdfst &&
blaasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfbla)
{
asdlalsdk;
}
(after reopening the settings, this second checkbox always is greyed out until I uncheck and recheck the first checkbos ("Enable line breaking"))
i can confirm this and this is a bug...
std::pair <std::multimap<int, std::tuple<int, double>>::iterator, std::multimap<int, std::tuple<int, double>>::iterator>
revXTRangeBoundsIter;
i can confirm that this line is not wrapped correctly. The AStyle plugin uses the possibilities of AStyle (https://sourceforge.net/projects/astyle/) so it could be possible that template wrapping is not implemented in the core lib, because it was designed for C ?
if(countEdgesToBeDeleted != 0)
{
shortcutsPerAdjNodeRatio = (double)
countShortcutsToBeCreated / countEdgesToBeDeleted;
}
calculatedRank = shortcutsPerAdjNodeRatio;
}
return calculatedRank;
}
There, even when selecting all first the line " countShortcutsToBeCreated / countEdgesToBeDeleted;" is vertically evened with the equal-sign of the line before.
There are much more of such lines beeing evened with an equal sign.
Else I cannot see a difference between using format astyle and first selecting all.