aboutsummaryrefslogtreecommitdiffstats
path: root/incdec.pm
diff options
context:
space:
mode:
authorTeddy Wing2021-08-28 19:42:31 +0200
committerTeddy Wing2021-08-28 19:42:31 +0200
commit729cdbe8c41598aaa70c7c71d708953dd72a6866 (patch)
tree08b099738c711f7d13f909fafe8c2e433a0043dd /incdec.pm
parent487e7220fe660e20b57f83edf0caf4b3ebdb2045 (diff)
downloadreadline-incdec-729cdbe8c41598aaa70c7c71d708953dd72a6866.tar.bz2
incdec.pm: Return both line and start position
I want access to the start position of the number being operated on. This will allow me to determine if point should be moved or not. Refactor everything to accept an array from `incdec()`.
Diffstat (limited to 'incdec.pm')
-rw-r--r--incdec.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/incdec.pm b/incdec.pm
index 5d0783e..a1e88a6 100644
--- a/incdec.pm
+++ b/incdec.pm
@@ -64,7 +64,7 @@ sub incdec {
$line =~ s/(-?\d+)/$1 + $increment_by/e;
}
- return $line;
+ return ($line, $start_position);
}
1;