]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
indent(1): improve handling of boxed comments indentation
authorpstef <pstef@FreeBSD.org>
Sun, 3 Jun 2018 15:28:55 +0000 (15:28 +0000)
committerpstef <pstef@FreeBSD.org>
Sun, 3 Jun 2018 15:28:55 +0000 (15:28 +0000)
commitd51ca1681c244aa02096e2ef589e778f7e7cca2b
treea1e1671abfc4fa8c398b06f79047cdde5e4fffe8
parentae62d09b33def49924dee61a650a7f4202357c88
indent(1): improve handling of boxed comments indentation

The trick is to copy everything from the start of the line into the buffer
that stores newlines and comments until indent finds a brace or an else.
pr_comment() will use that information to calculate the original indentation
of the boxed comment.

This requires storing two pieces of information: the real start of the
buffer (sc_buf) and the start of the comment (save_com).
usr.bin/indent/indent.c
usr.bin/indent/indent_globs.h
usr.bin/indent/pr_comment.c
usr.bin/indent/tests/comments.0
usr.bin/indent/tests/comments.0.stdout