diff options
| author | Teddy Wing | 2021-08-28 22:07:19 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2021-08-28 22:07:19 +0200 | 
| commit | c8fa19d038ed79c640c5164735179611e95520d6 (patch) | |
| tree | ad987741fd3fdd66342992cf6140f699a7a7b17d /t/100-increment-decrement.t | |
| parent | 729cdbe8c41598aaa70c7c71d708953dd72a6866 (diff) | |
| download | readline-incdec-c8fa19d038ed79c640c5164735179611e95520d6.tar.bz2 | |
incdec.bash: Set up point moving after start position
This doesn't work yet as it turns out it requires a change to the
`incdec()` Perl subroutine.
We want to move point when switching between positive and negative
numbers (adding or removing a hypen negative sign), but only if point is
on or after the start of the number being incremented. If point is
before that, it looks like it's moving.
Read the start index from the `incdec()` subroutine and prefix it to the
output line in the format: "${start_position}#${output_line}". We can
then use the "#" to split the two values and extract them in the Bash
functions.
Needed to move setting `$READLINE_LINE` to the increment and decrement
Bash functions because I now run `__readline_incdec` in a subshell,
meaning the current line can't be manipulated with that variable in that
function.
In the increment and decrement Bash functions, we now check if the start
position of the incremented number is less than or equal to
`$READLINE_POINT` before trying to move point.
Diffstat (limited to 't/100-increment-decrement.t')
0 files changed, 0 insertions, 0 deletions
