aboutsummaryrefslogtreecommitdiffstats
path: root/incdec.pm
diff options
context:
space:
mode:
authorTeddy Wing2021-08-08 20:55:41 +0200
committerTeddy Wing2021-08-08 20:55:41 +0200
commitccfbd51f1d4b39e5778fed6facf15c7815b2b6aa (patch)
tree4e7b95de3bccd5474a54a859845de06f73e2a8e4 /incdec.pm
parent3c499b509196b246be487700149295c9ccf2bee8 (diff)
downloadreadline-incdec-ccfbd51f1d4b39e5778fed6facf15c7815b2b6aa.tar.bz2
incdec: Describe the 'point within number' handling
Diffstat (limited to 'incdec.pm')
-rw-r--r--incdec.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/incdec.pm b/incdec.pm
index d2982c4..d4b1460 100644
--- a/incdec.pm
+++ b/incdec.pm
@@ -9,8 +9,9 @@ sub incdec {
$point_position ||= 0;
$is_backward ||= 0;
+ # If point is within a number, move it to ensure we match the whole number
+ # rather than only part of its digits.
$line =~ /(\d+)/;
-
if ($-[0] <= $point_position && $point_position < $+[0]) {
$point_position = $-[0];
}