Autoformatting

Tony Reina
2005-04-27
2012-09-26
  • Tony Reina
    Tony Reina
    2005-04-27

    I know that the use of 3rd-party tools for code beautification (e.g. astyle or indent) has been discussed before. I was wondering if the auto-indent feature of dev-cpp could be used as a built-in beautifier.

    From what I can tell, auto-indent only works as you type the code from scratch. It won't auto-indent existing code. Is there any reason why the auto-indent code can't be expanded to work on code that the user highlights with the mouse? I'd be willing to try coding it, if someone could give me an idea of where in the code to look (and verify that I'm not trying something that can't be done).

     
    • I'm not sure how would it work (on demand or while typing)? But there's no easy way to tell exactly where to look. there actually could be a few way to do it. you may need to know synedit api

       
    • Tony Reina
      Tony Reina
      2005-05-03

      I was thinking of on demand. Essentially, the user would highlight the section of the code they wanted to format. The autoformat code would be applied to that section as if it were being typed in fresh by the user. If the user selected everything, then the entire file would be formatted automatically.

       
  • Daniel
    Daniel
    2011-05-15

    Hello, This was such a nice info relating you have shared with us. I like it
    because I was seeking for this from long time. Hope this will benefits all who
    land up here.
    Keep sharing………Thanks!!


    krogen krogragg dating festa