From owner-svn-src-head@freebsd.org Sun Jul 23 20:25:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAB34DAC7A9; Sun, 23 Jul 2017 20:25:54 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99DFA6E275; Sun, 23 Jul 2017 20:25:54 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6NKPrDP091559; Sun, 23 Jul 2017 20:25:53 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6NKPrOe091556; Sun, 23 Jul 2017 20:25:53 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <201707232025.v6NKPrOe091556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Sun, 23 Jul 2017 20:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321396 - in head/usr.bin/indent: . tests X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: in head/usr.bin/indent: . tests X-SVN-Commit-Revision: 321396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jul 2017 20:25:54 -0000 Author: pstef Date: Sun Jul 23 20:25:53 2017 New Revision: 321396 URL: https://svnweb.freebsd.org/changeset/base/321396 Log: indent(1): better alignment of comments on code. If aligning the beginning of a comment to -cn would mean no space between code and the comment, align it to the next tab stop. Modified: head/usr.bin/indent/pr_comment.c head/usr.bin/indent/tests/comments.0 head/usr.bin/indent/tests/comments.0.stdout Modified: head/usr.bin/indent/pr_comment.c ============================================================================== --- head/usr.bin/indent/pr_comment.c Sun Jul 23 19:54:54 2017 (r321395) +++ head/usr.bin/indent/pr_comment.c Sun Jul 23 20:25:53 2017 (r321396) @@ -141,7 +141,7 @@ pr_comment(void) target_col = count_spaces(compute_label_target(), s_lab); } ps.com_col = ps.decl_on_line || ps.ind_level == 0 ? ps.decl_com_ind : ps.com_ind; - if (ps.com_col < target_col) + if (ps.com_col <= target_col) ps.com_col = ((target_col + 7) & ~7) + 1; if (ps.com_col + 24 > adj_max_col) adj_max_col = ps.com_col + 24; Modified: head/usr.bin/indent/tests/comments.0 ============================================================================== --- head/usr.bin/indent/tests/comments.0 Sun Jul 23 19:54:54 2017 (r321395) +++ head/usr.bin/indent/tests/comments.0 Sun Jul 23 20:25:53 2017 (r321396) @@ -1,4 +1,11 @@ /* $FreeBSD$ */ +typedef enum x { + aaaaaaaaaaaaaaaaaaaaaa = 1 << 0, /* test a */ + bbbbbbbbbbbbbbbbb = 1 << 1, /* test b */ + cccccccccccccc = 1 << 1, /* test c */ + dddddddddddddddddddddddddddddd = 1 << 2 /* test d */ +} x; + /* See r303597, r303598, r309219, and r309343 */ void t(void) { /* Modified: head/usr.bin/indent/tests/comments.0.stdout ============================================================================== --- head/usr.bin/indent/tests/comments.0.stdout Sun Jul 23 19:54:54 2017 (r321395) +++ head/usr.bin/indent/tests/comments.0.stdout Sun Jul 23 20:25:53 2017 (r321396) @@ -1,4 +1,11 @@ /* $FreeBSD$ */ +typedef enum x { + aaaaaaaaaaaaaaaaaaaaaa = 1 << 0, /* test a */ + bbbbbbbbbbbbbbbbb = 1 << 1, /* test b */ + cccccccccccccc = 1 << 1, /* test c */ + dddddddddddddddddddddddddddddd = 1 << 2 /* test d */ +} x; + /* See r303597, r303598, r309219, and r309343 */ void t(void)