diff options
| author | Teddy Wing | 2021-08-22 20:55:46 +0200 |
|---|---|---|
| committer | Teddy Wing | 2021-08-22 20:55:46 +0200 |
| commit | 250252e775486f9d60652a4b4490caac6756e767 (patch) | |
| tree | 870f1aef4124b48c56e2a3d7aa4b212c73a1d098 | |
| parent | a37e4cc946d2948d19040722fc5e6ea2f6e3bc17 (diff) | |
| download | readline-incdec-250252e775486f9d60652a4b4490caac6756e767.tar.bz2 | |
incdec.pm: Add descriptions for the backwards handling
Describe why we set `$point_position` the way we do.
| -rw-r--r-- | incdec.pm | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -23,7 +23,15 @@ sub incdec { # && $point_position < $-[0]) { # Try always setting $start_position and resetting it if there's another number? + # TODO: document, last number handling + + # Set start position to the current match start. This gives us the + # correct start position when incrementing the last number in a + # line. $start_position = $-[0]; + + # If point is not at the end, set start position to the number + # closest to the point position. if ($point_position < $-[0]) { # print "match at [$previous_match_start]"; $start_position = $previous_match_start; |
