aboutsummaryrefslogtreecommitdiffstats
path: root/incdec.pm
diff options
context:
space:
mode:
authorTeddy Wing2021-08-15 19:47:18 +0200
committerTeddy Wing2021-08-15 19:53:21 +0200
commit43eed8f077a6af734adb92f7999a6cdeff0715dd (patch)
treee51dcaa6780108d94cc8de673c1a8d5af95bf801 /incdec.pm
parent24495f6638809ca7d0db9ec6984a7c413abd2a58 (diff)
downloadreadline-incdec-43eed8f077a6af734adb92f7999a6cdeff0715dd.tar.bz2
incdec: Correctly handle middle-of-number point for third number
We were previously using values specific to the first and second numbers in the line. Get middle-of-number point handling working for the third number in the line, and hopefully the rest as well.
Diffstat (limited to 'incdec.pm')
-rw-r--r--incdec.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/incdec.pm b/incdec.pm
index 3f4c8ef..bcf62e0 100644
--- a/incdec.pm
+++ b/incdec.pm
@@ -25,10 +25,10 @@ sub incdec {
}
if ($point_position >= $+[0]) {
- $line_start .= substr($line_part, $previous_point_position, $+[0]);
+ $line_start .= substr($line_part, 0, $+[0]);
$line_part = substr($line_part, $+[0]);
$previous_point_position = $point_position;
- $point_position = 0;
+ $point_position -= $+[0];
next;
}