1. Ben Bluemel
  2. IndentByFold

Issues

Issue #2 wontfix

IntentByFold - Reintent problem

perlj
created an issue

Hi, The menu choise "Reintent file" does not really suit the way of how we on our company format our c code.

{{{

!c

void MyFunction(int a, //Input parameter a char b, //Input parameter b long c) //Output parameter c

will become:

void MyFunction(int a, //Input parameter a char b, //Input parameter b long c) //Output parameter c }}} This does not look so nice.

Perhaps this is not a common way of typing c code but for us it is.

So my question is:

Is it possible to get the intent in a correct way or is it possible to add a "Reintent selection" menu choice so I can deside which code to reintent

Comments (2)

  1. Ben Bluemel repo owner

    Hi,

    IndentbyFold is intended to be Language Agnostic by working off fold points provided by lexers, with the reindent file option, it only really examines whether the fold level has increased or decreased over the previous line, and indents accordingly.

    So in your case there are two issues 1) the c lexer does not provide fold levels for ( and ). 2) IndentByFold will only increase indentation, it won't line up code.

    There is another plugin called Code Alignment, which may do what you are after, but I have never used it.

    As for a Reindent Selection option, I have thought about doing it in the past (along with a reindent on paste option), however I haven't got around to either, mainly down to working mostly on my ColdFusion plugin.

    But will mark this as an enhancement request for the inclusion of a Reindent Selection option.

    Cheers

    Ben

  2. Log in to comment