nevir/groc — pull request #123 by sjorek (2013-09-24 11:51:15+00:00)
Title: Fix: missing proper whitespace-handling after foldPrefix- and ignorePrefix 

This commit strips one whitespace from the comment-line after the `foldPrefix` or the `ignorePrefix` if this whitespace is followed by a non whitespace. This strips the unnecessary whitespace from the comments taken from `lib/utils.coffee`, without interfering too much with possible code-block- or bullet-list-indention.

- - -

Source:

# ^ … if we start this comment with “^” instead of “}” it and all
# } code up to the next segment's first comment starts folded

Current result (notice the _two_ whitespace-chars between `#` and the comment):

# … if we start this comment with “^” instead of “}” it and all
# code up to the next segment's first comment starts folded

Patched result (notice the _single_ whitespace between `#` and the comment):

# … if we start this comment with “^” instead of “}” it and all
# code up to the next segment's first comment starts folded

- - -

Source:

# ^ - fold this list
# } - fold the list
# } - fold the list

Current result (notice the _two_ whitespace-chars between `#` and the comment):

# - fold this list
# - fold the list
# - fold the list

Patched result (notice the _single_ whitespace between `#` and the comment):

# - fold this list
# - fold the list
# - fold the list

- - -

Source:

#^ - fold this list
#} - fold the list
#} - fold the list

Current and patched result (notice the single whitespace between `#` and the comment):

# - fold this list
# - fold the list
# - fold the list

- - -

The same principles apply for block-comments too.