From ccfbd51f1d4b39e5778fed6facf15c7815b2b6aa Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 8 Aug 2021 20:55:41 +0200 Subject: incdec: Describe the 'point within number' handling --- incdec.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'incdec.pm') 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]; } -- cgit v1.2.3