diff options
| -rw-r--r-- | incdec.bash | 11 | ||||
| -rw-r--r-- | incdec.pm | 11 | 
2 files changed, 4 insertions, 18 deletions
| diff --git a/incdec.bash b/incdec.bash index 0b8eae3..4b621f7 100644 --- a/incdec.bash +++ b/incdec.bash @@ -31,7 +31,6 @@ sub incdec {  	$is_backward ||= 0;  	my $start_position = 0; -	# my $previous_match_start = $point_position;  	my $previous_match_start = 0;  	my $i = 0;  	while ($line =~ /(-?\d+)/g) { @@ -67,14 +66,8 @@ sub incdec {  		}  	} -	# Using `\G` when `pos` is 0 seems to cause occasional missed substitutions. -	# if ($start_position > 0) { -		pos($line) = $start_position; -		$line =~ s/\G(-?\d+)/$1 + $increment_by/e; -	# } -	# else { -	# 	$line =~ s/(-?\d+)/$1 + $increment_by/e; -	# } +	pos($line) = $start_position; +	$line =~ s/\G(-?\d+)/$1 + $increment_by/e;  	return ($line, $start_position);  } @@ -28,7 +28,6 @@ sub incdec {  	$is_backward ||= 0;  	my $start_position = 0; -	# my $previous_match_start = $point_position;  	my $previous_match_start = 0;  	my $i = 0;  	while ($line =~ /(-?\d+)/g) { @@ -64,14 +63,8 @@ sub incdec {  		}  	} -	# Using `\G` when `pos` is 0 seems to cause occasional missed substitutions. -	# if ($start_position > 0) { -		pos($line) = $start_position; -		$line =~ s/\G(-?\d+)/$1 + $increment_by/e; -	# } -	# else { -	# 	$line =~ s/(-?\d+)/$1 + $increment_by/e; -	# } +	pos($line) = $start_position; +	$line =~ s/\G(-?\d+)/$1 + $increment_by/e;  	return ($line, $start_position);  } | 
