juliapath / evil-numbers

Increment and decrement numbers in Emacs
GNU General Public License v3.0
39 stars 6 forks source link

fix: handle hyphen-separated numbers correctly #7

Closed midchildan closed 4 years ago

midchildan commented 4 years ago

Imagine we're editing hyphen-separated numbers like the following:

cursor:          v
text:   2020-01-02

When we invoke inc-at-pt, we want the last number to change:

cursor:          v
text:   2020-01-01

(Note that the number is decremented instead of being incremented due to the leading -. This also matches Vim behavior)

However, evil-numbers currently change the first number instead:

cursor:    v
text:   2021-01-02

This patch fixes evil-numbers to match the expected behavior.

midchildan commented 4 years ago

Fixed a typo in the commit message.

juliapath commented 4 years ago

Thank you and thanks for the ping