Indentations in kdev4

Fred Labrosse ffl at aber.ac.uk
Wed Nov 4 11:27:45 GMT 2009


Hi,

I'm kind of fitting with automatic alignment of code.  This is c++.  I have 
Tab assigned to Align and that works (although it seems to lose it now and 
then),  What does not seem to work as I set it up is the alignment level.

I have setup in Kdevelop settings in "Source formatter settings" my own 
settings.  All the plugins are selected, which includes a "source formatter" 
and an "Indent formatter backend".  In the settings of the editor, there is 
yet another indentation setting (in Editing) and I have set that to None, 
Normal, C style without making any difference.

Yet, my code is not auto aligned as I specified, and in fact is weirdly 
aligned here and there, with, eg:

double distance(const image<typeCol, nbColComp>& img,
                const appearance<typeCol, nbColComp>& appear,
                const transformation& transf)
               {
                  #ifndef NDEBUG
                  double xBBMin, yBBMin, xBBMax, yBBMax;
                  transf.apply(appear.getBBxMin());
                  transf.apply(appear.getBBxMax());
                  assert((round(xBBMax) < img.nbColumns())
                  && (static_cast<long>(round(xBBMin)) >= 0)
                  && (static_cast<long>(round(yBBMax)) < img.nbRows())
                  && (static_cast<long>(round(yBBMin)) >= 0));
                  #endif // ndef NDEBUG
                        

etc (this is incomplete code to avoid linebreaks in the mail).  In the 
above, the opening { should have been aligned with the beginning of the line 
and the && with the opening ( of the assert.

Any idea on what I'm doing wrong?

Cheers,

P.S.  I seem to remember that I initially had similar problems with kdev3 
but that in the end I did manage to make it work (can't remember how 
though).




More information about the KDevelop mailing list