]> git.donarmstrong.com Git - perltidy.git/commitdiff
minor -vsn improvements
authorSteve Hancock <perltidy@users.sourceforge.net>
Thu, 15 Feb 2024 02:57:41 +0000 (18:57 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Thu, 15 Feb 2024 02:57:41 +0000 (18:57 -0800)
CHANGES.md
lib/Perl/Tidy/VerticalAligner.pm
t/snippets/expect/vsn.vsn1
t/snippets29.t

index d94ae8f841b2998012a2a51cd113f3006c7fcb17..4ecc53fcf394b74c7ac31828a9921c05bdf3cfb7 100644 (file)
@@ -5,17 +5,14 @@
     - The option --delete-repeated-commas is now the default.
 
       It makes the following checks and changes:
-      - Repeated commas like ',,' on the same line are removed with a warning
-      - Repeated fat commas like '=> =>' on the same line are removed with a
+      - Repeated commas like ',,' are removed with a warning
+      - Repeated fat commas like '=> =>' are removed with a
         warning
-      - Repeated commas and fat commas on different lines remain unchanged but
-        produce a warning (to avoid promoting a side-comment to block comment)
-      - The combination '=>,' produces a warning but is not changed (it is
-        likely an error but only its author would know how to fix it).
-      These warnings are only output if the --warning-output, -w flag is set.
+      - The combination '=>,' produces a warning but is not changed
+      These warnings are only output if --warning-output, or -w, is set.
 
       This is now the DEFAULT Behavior.
-      To avoid this change, use --nodelete-repeated-commas, or -ndrc.
+      Use --nodelete-repeated-commas, or -ndrc, to turn this option off.
 
     - Added control --delete-interbracket-arrows, or -dia, to delete optional
       hash ref and array ref arrows between brackets as in the following
index b2176074a6261a25128b309186022227a7d08f01..8538b2e32663fd1073a24f2b472ff632f61bffce 100644 (file)
@@ -5013,15 +5013,11 @@ EOM
         $is_single_col = $jmax == 1;
     }
 
-    # Skip padding in a large table, or single column, where 'most'
-    # of the signed values are shorter than the unsigned values.
-    # The median is used to make this insensitive to small changes.
-    if ( $median_unsigned_length >= $median_signed_length ) {
-        if (   $is_single_col
-            || $nlines > $rOpts_valign_signed_numbers_limit / 2 )
-        {
-            return;
-        }
+    # Skip padding in a table where 'most' of the signed values are shorter
+    # than the unsigned values. Require at least 3 unsigned values for this
+    # test to reduce the influence of the min and max values
+    if ( $median_unsigned_length >= $median_signed_length && $unsigned > 2 ) {
+        return;
     }
 
     #--------------------------------------
index 026a3c27855077e02243c6e0e0d040b713a05f15..c196ac479774d54ba02dacf83e2314cb6c5794d1 100644 (file)
@@ -1,9 +1,9 @@
 @data = (
          ["1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th"],
-         [ 1,     2,    5,     6,      3,     1.5,  -1,    -3,    -4],
+         [ 1,     2,    5,     6,     3,      1.5,  -1,    -3,    -4],
          [-4,    -3,    1,     1,     -3,    -1.5,  -2,    -1,     0],
-         [ 9,     8,    9,     8.4,    7.1,   7.5,   8,     3,    -3],
-         [ 0.1,   0.2,  0.5,   0.4,    0.3,   0.5,   0.1,   0,     0.4],
+         [ 9,     8,    9,     8.4,   7.1,    7.5,   8,     3,    -3],
+         [ 0.1,   0.2,  0.5,   0.4,   0.3,    0.5,   0.1,   0,     0.4],
         );
 
 $s->drawLine( 35,  0);
index 64c55bd26fea6e9f0d24b343cc4150981dda55f7..129aed1a294d204672ce19deffdd291169b4ce28 100644 (file)
@@ -128,10 +128,10 @@ $s->drawLine( 0,   -10 );
             expect => <<'#3...........',
 @data = (
          ["1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th"],
-         [ 1,     2,    5,     6,      3,     1.5,  -1,    -3,    -4],
+         [ 1,     2,    5,     6,     3,      1.5,  -1,    -3,    -4],
          [-4,    -3,    1,     1,     -3,    -1.5,  -2,    -1,     0],
-         [ 9,     8,    9,     8.4,    7.1,   7.5,   8,     3,    -3],
-         [ 0.1,   0.2,  0.5,   0.4,    0.3,   0.5,   0.1,   0,     0.4],
+         [ 9,     8,    9,     8.4,   7.1,    7.5,   8,     3,    -3],
+         [ 0.1,   0.2,  0.5,   0.4,   0.3,    0.5,   0.1,   0,     0.4],
         );
 
 $s->drawLine( 35,  0);