aboutsummaryrefslogtreecommitdiffstats
path: root/incdec.m4.bash
AgeCommit message (Collapse)Author
2021-08-29incdec.bash: Remove start position debug prints and TODOTeddy Wing
This works now.
2021-08-28incdec.bash: Set up point moving after start positionTeddy Wing
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.
2021-08-28incdec.bash: Add TODO about moving pointTeddy Wing
2021-08-25Add a version number to included scriptsTeddy Wing
2021-08-25incdec: Move bindings to a new fileTeddy Wing
Split the bindings from the function definitions. This will allow users to source the functions and define their own bindings. The bindings file can be sourced to get the default bindings.
2021-08-24Add license (GNU GPLv3+)Teddy Wing
2021-08-24incdec: Change default bindings to `C-x a` and `C-x x`Teddy Wing
I had used `C-x +` and `C-x -` during testing because I had an existing non-"-x" binding that was prefixed with `C-x a`, and when I tried to add the `C-x a` "-x" binding, it caused the following error: bash_execute_unix_command: cannot find keymap for command Switch the default bindings to `C-x a` and `C-x x` because those are the ones I originally wanted, since they don't appear to conflict with any existing default Readline bindings, and they're similar to the Vim increment and decrement commands.
2021-08-24incdec: Add comments to describe Bash functionsTeddy Wing
2021-08-24incdec: Remove old codeTeddy Wing
Now that we have this working, remove the old functions, binding definitions, and TODOs. All TODOs here are handled. The old Bash functions and bindings were for a Bash-only implementation. The point-moving code in `__readline_incdec_decrement` wasn't applicable to decrementing numbers.
2021-08-23Highlight `incdec.m4` as a Bash fileTeddy Wing
When I changed the file to an M4 file, it removed Bash syntax highlighting, and the `include()` call interfered with Bash quote matching. Use a different macro to include the Perl file so we can get Bash syntax highlighting.