Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Jun 2018 09:32:43 +0000 (UTC)
From:      Piotr Pawel Stefaniak <pstef@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334477 - in head/usr.bin/indent: . tests
Message-ID:  <201806010932.w519WhXD001354@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pstef
Date: Fri Jun  1 09:32:42 2018
New Revision: 334477
URL: https://svnweb.freebsd.org/changeset/base/334477

Log:
  indent(1): consider tab characters when forcing a newline after a comma

Modified:
  head/usr.bin/indent/indent.c
  head/usr.bin/indent/tests/declarations.0
  head/usr.bin/indent/tests/declarations.0.stdout

Modified: head/usr.bin/indent/indent.c
==============================================================================
--- head/usr.bin/indent/indent.c	Fri Jun  1 09:17:20 2018	(r334476)
+++ head/usr.bin/indent/indent.c	Fri Jun  1 09:32:42 2018	(r334477)
@@ -1058,7 +1058,9 @@ check_type:
 	    if (ps.p_l_follow == 0) {
 		if (ps.block_init_level <= 0)
 		    ps.block_init = 0;
-		if (break_comma && (!ps.leave_comma || compute_code_target() + (e_code - s_code) > max_col - tabsize))
+		if (break_comma && (!ps.leave_comma ||
+		    count_spaces_until(compute_code_target(), s_code, e_code) >
+		    max_col - tabsize))
 		    force_nl = true;
 	    }
 	    break;

Modified: head/usr.bin/indent/tests/declarations.0
==============================================================================
--- head/usr.bin/indent/tests/declarations.0	Fri Jun  1 09:17:20 2018	(r334476)
+++ head/usr.bin/indent/tests/declarations.0	Fri Jun  1 09:32:42 2018	(r334477)
@@ -44,6 +44,7 @@ void t2 (char *x, int y)
 	,n
 	,o
 	;
+	int		chars[ /* push the comma beyond column 74 .... */ ], x;
 }
 
 const int	int_minimum_size =

Modified: head/usr.bin/indent/tests/declarations.0.stdout
==============================================================================
--- head/usr.bin/indent/tests/declarations.0.stdout	Fri Jun  1 09:17:20 2018	(r334476)
+++ head/usr.bin/indent/tests/declarations.0.stdout	Fri Jun  1 09:32:42 2018	(r334477)
@@ -36,6 +36,8 @@ t2(char *x, int y)
 		       ,n
 		       ,o
 		       ;
+	int		chars[ /* push the comma beyond column 74 .... */ ],
+			x;
 }
 
 const int	int_minimum_size =



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806010932.w519WhXD001354>