Menu

Autoformatting

Tony Reina
2005-04-27
2023-09-30
  • 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).

     
    • Marek Januszewski

      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

     
  • Arham Khan 0692

    Arham Khan 0692 - 2023-09-30

    On-demand was what I had in mind. In essence, the user would select the code block they wished to format. The autoformat code would be applied to that part as though the user had just started typing it. If the user made every choice, the entire file would be automatically formatted.

     

Log in to post a comment.