diff options
| author | Teddy Wing | 2021-08-08 20:49:13 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2021-08-08 20:49:13 +0200 | 
| commit | 3c499b509196b246be487700149295c9ccf2bee8 (patch) | |
| tree | b5a7994bd90a7e1e80fde408bd2f404e1a683765 | |
| parent | 5950add03889fc9a8cb6faface53903cebf3a206 (diff) | |
| download | readline-incdec-3c499b509196b246be487700149295c9ccf2bee8.tar.bz2 | |
incdec: Fix increment when cursor is after the first number
* Needed the comparison to be `<`, otherwise the cursor becomes part of
  the first number.
* The boolean operation was wrong: `$point_position` needs to be both
  above the start of the match and below the end of the match to be
  inside it.
| -rw-r--r-- | incdec.pm | 3 | 
1 files changed, 1 insertions, 2 deletions
| @@ -10,9 +10,8 @@ sub incdec {  	$is_backward ||= 0;  	$line =~ /(\d+)/; -	# print $-[0] . ':' . $+[0] . ';' . $point_position; -	if ($-[0] <= $point_position || $point_position <= $+[0]) { +	if ($-[0] <= $point_position && $point_position < $+[0]) {  		$point_position = $-[0];  	} | 
