aboutsummaryrefslogtreecommitdiffstats
path: root/incdec.bash
diff options
context:
space:
mode:
authorTeddy Wing2021-08-29 00:45:33 +0200
committerTeddy Wing2021-08-29 00:48:35 +0200
commit40289847cae91a317a660d38ec4c6a48164f58f6 (patch)
treee3807f32df9753629f63cc452230d82afe78d64b /incdec.bash
parente56b8c2e88c8c5444f66634dbe3c511a5f37a3d6 (diff)
downloadreadline-incdec-40289847cae91a317a660d38ec4c6a48164f58f6.tar.bz2
incdec.pm: Clean up code from previous start position commit
Diffstat (limited to 'incdec.bash')
-rw-r--r--incdec.bash11
1 files changed, 2 insertions, 9 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);
}