There are still other places in this file that use `-1` and `+1` for direction, albeit for up/down line movements.
I suggest renaming these constants to the a spatially neutral pair like `BACKWARD` and `FORWARD` (or another more appropriate name, perhaps `PREVIOUS` and `NEXT`), and using that everywhere in this file.