Menu

#84 Add option to delete extra empty lines

1.0
closed
None
2023-05-19
2014-06-25
No

Patch attached which adds option --delete-extra-empty-lines / -xE to remove extra empty lines (where there is two or more). Keeps a single empty line.

1 Attachments

Discussion

  • Lars Christensen

    Edited patch which included an unintended change to dist-format-astyle.bat.

     
  • Jim Pattee

    Jim Pattee - 2018-01-28

    Ticket moved from /p/astyle/bugs/289/

     
  • JimH

    JimH - 2018-12-12

    Just looking for exactly this option - delete any extra lines in a seqence of 2 or more empty lines. Did it ever make it in to the mainline?

     
    • Jim Pattee

      Jim Pattee - 2018-12-12

      Sorry, this hasn't been implemented yet.

       

      Jim Pattee
      jimp03@email.com
       
       
      Sent: Wednesday, December 12, 2018 at 8:55 AM
      From: JimH <jamesh65@users.sourceforge.net>
      To: "[astyle:tickets] " <84@tickets.astyle.p.re.sourceforge.net>
      Subject: [astyle:tickets] #84 Add option to delete extra empty lines
      Just looking for exactly this option - delete any extra lines in a seqence of 2 or more empty lines. Did it ever make it in to the mainline?


      ---

      ** [tickets:#84] Add option to delete extra empty lines**

      **Status:** open
      **Milestone:** None
      **Created:** Wed Jun 25, 2014 11:16 AM UTC by Lars Christensen
      **Last Updated:** Wed Dec 12, 2018 03:54 PM UTC
      **Owner:** nobody
      **Attachments:**

      - [astyle-delete-extra-empty-lines.patch](https://sourceforge.net/p/astyle/tickets/84/attachment/astyle-delete-extra-empty-lines.patch) (7.1 kB; application/octet-stream)


      Patch attached which adds option --delete-extra-empty-lines / -xE to remove extra empty lines (where there is two or more). Keeps a single empty line.


      ---

      Sent from sourceforge.net because you indicated interest in <https://sourceforge.net/p/astyle/tickets/84/>



      To unsubscribe from further messages, please visit <https://sourceforge.net/auth/subscriptions/>



       
  • Alexander Behrens

    I really appreciate this feature. But I would like to suggest an addition: You should distinguish between empty lines between expressions (type 2) and outside of function bodies (type 1).

    #include <>
    #include <>
    <max/exact number of empty lines type 2>
    #include <>
    #include <>
    <max/exact number of empty lines type 2>
    <expr1>;
    <max/exact number of empty lines type 2>
    <expr2>;
    <max/exact number of empty lines type 1>
    void fun1()
    {
        <expr1>;
        <max/exact number of empty lines type 2>
        <expr2>;
    }
    <max/exact number of empty lines type 1>
    /**
      *
      */
    void fun1()
    {
        <expr1>;
        <max/exact number of empty lines type 2>
        <expr2>;
    }
    
     
  • André Simon

    André Simon - 2023-04-25
    • status: open --> accepted
    • assigned_to: André Simon
    • Milestone: --> 1.0
     
  • André Simon

    André Simon - 2023-04-25

    In the 3.3-beta2 version, there is a new feature available called "--squeeze-lines=#" which allows you to remove consecutive lines that exceed the specified number.
    For example, if you set the value to 2, any third and subsequent empty lines will be eliminated.
    This means that you can still preserve visual gaps if you prefer to do so.

     
  • André Simon

    André Simon - 2023-05-19
    • status: accepted --> closed
     

Log in to post a comment.