Menu

#14 Improves indentation for 'begin'/'end' while several ones

open
nobody
None
5
2012-07-29
2012-07-29
No

When several \end and/or \begin of environments lies on the same line, the indentation is not always relevant.
This patch tries to fix it with a little bit of refactoring too (the code for \begin and \end is refactored to one function).
I did some tests and it should normally work now for even the most extreme cases.

Discussion

  • Benoît Legat

    Benoît Legat - 2012-07-29

    Patch for the improvement

     
  • Ted Pavlic

    Ted Pavlic - 2012-08-09

    Looks OK to me. I'll commit it after a couple of minor changes.

    1. Correct spelling of "Exemples" to "Examples" (do a search and replace in the comments).

    2. Correct spelling of "occurence" to "occurrence" (again, in the comments).

    3. Correct spelling of "substraction" to "subtraction" (comments).

    4. (not that big of a deal; just for consideration) Change "parameters" to "arguments" throughout comments.

    5. (not that important, but just to consider) I don't really like using "->" to mean "returns" as it already has a loaded meaning in CS as "gets." Really, "HasEnv" is a predicate that is either asserted or not. So I'd almost like to see something like...

    "For example, both of the following are asserted (or you could say "true", I suppose):

    HasEnv( ..., ... )
    ! HasEnv( ..., ...)"

    You could do something similar with BeginEnd using double equals in the comments. Like:

    "For example, all of the following are asserted (or, again, true, I suppose):

    BeginEnd( ..., ..., ...) == 1
    BeginEnd( ..., ..., ...) == 1
    BeginEnd( ..., ..., ...) == 2
    BeginEnd( ..., ..., ...) == 0"

    Make at least changes 1 through 3, and I'll commit your patch and push it.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.