Indentations in kdev4

Fred Labrosse ffl at aber.ac.uk
Wed Nov 4 11:32:22 GMT 2009


On Wednesday 04 November 2009 11:27:45 Fred Labrosse wrote:
> 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.

I should have added that something similat happens in for loops:

      for (iter = appear.pixels().begin();
      iter < appear.pixels().end();
      ++iter)
      {

Fred




More information about the KDevelop mailing list