]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix issue b1457
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 7 Jul 2023 14:51:27 +0000 (07:51 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 7 Jul 2023 14:51:27 +0000 (07:51 -0700)
dev-bin/run_convergence_tests.pl.data
dev-bin/run_convergence_tests.pl.expect
lib/Perl/Tidy/Formatter.pm

index 9e4b98c6a693e2eeb1034dda42528008129525ea..2cbc58112c3ba90941ecb3ed6695aedc4f7cde61 100644 (file)
@@ -11625,6 +11625,47 @@ if ($BOLD_MATH) {
 --short-concatenation-item-length=1
 --want-trailing-commas='h'
 
+==> b1457.in <==
+BEGIN {
+         %messages=(
+                  0x95 => [
+                           StartSessionTransmission =>
+                                    qw( *_RemoteIPAddr V_SessionType )
+                  ],
+                  0x93 => [
+                             ConfigStat =>qw( Z16_DeviceName V_StationUserID
+                             V_StationUserInstance
+                             Z16_UserName Z16_ServerName
+                             V_NumberLines V_NumberSpeedDials )
+                  ],
+         ) ;
+}
+
+BEGIN {
+         %messages=(
+                  0x95 => [
+                           StartSessionTransmission =>
+                                    qw( *_RemoteIPAddr V_SessionType )
+                  ],
+                  0x93 => [
+                           ConfigStat =>
+                                    qw( Z16_DeviceName V_StationUserID
+                                    V_StationUserInstance
+                                    Z16_UserName Z16_ServerName
+                                    V_NumberLines V_NumberSpeedDials )
+                  ],
+         ) ;
+}
+
+
+==> b1457.par <==
+--maximum-line-length=76
+--indent-columns=9
+--continuation-indentation=9
+--noadd-whitespace
+--extended-continuation-indentation
+--extended-line-up-parentheses
+
 ==> b146.in <==
 # State 1
 
index 68fb8f17ddf87e3f51578333affc6491061873a5..f19eb8192ad7509e317bd8be664b723976bddfe9 100644 (file)
@@ -7869,6 +7869,38 @@ if ($BOLD_MATH) {
                            " " . $user->{lastname}, selected => '0',
                       };
 
+==> b1457 <==
+BEGIN {
+         %messages=(
+                  0x95 => [
+                           StartSessionTransmission =>
+                                    qw( *_RemoteIPAddr V_SessionType )
+                  ],
+                  0x93 => [
+                             ConfigStat =>qw( Z16_DeviceName V_StationUserID
+                             V_StationUserInstance
+                             Z16_UserName Z16_ServerName
+                             V_NumberLines V_NumberSpeedDials )
+                  ],
+         ) ;
+}
+
+BEGIN {
+         %messages=(
+                  0x95 => [
+                           StartSessionTransmission =>
+                                    qw( *_RemoteIPAddr V_SessionType )
+                  ],
+                  0x93 => [
+                             ConfigStat =>qw( Z16_DeviceName V_StationUserID
+                             V_StationUserInstance
+                             Z16_UserName Z16_ServerName
+                             V_NumberLines V_NumberSpeedDials )
+                  ],
+         ) ;
+}
+
+
 ==> b146 <==
 # State 1
 
index ba5499a8bdfd5c0197ea55956f467a9a0bfa6453..223462eb5045efd45feb23266dfb2857809bdccd 100644 (file)
@@ -14370,6 +14370,16 @@ EOM
             # Count lengths of things like 'xx => yy' as a single item
             if ( $type eq '=>' ) {
                 $len += $token_length + 1;
+
+                # fix $len for -naws, issue b1457
+                if ( !$rOpts_add_whitespace ) {
+                    if ( defined( $rLL->[ $KK + 1 ] )
+                        && $rLL->[ $KK + 1 ]->[_TYPE_] ne 'b' )
+                    {
+                        $len -= 1;
+                    }
+                }
+
                 if ( $len > $max_prong_len ) { $max_prong_len = $len }
             }
             elsif ( $last_nonblank_type eq '=>' ) {