You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
searches for number up to eol and then increments or decrements and keep zero padding up (unlike in vim)
@cofi, out of curiosity, what was the rationale behind this decision?
I'm sure there are pros and cons in both approaches, and padding doesn't always suit as well (see @mlf176f2's PR for just one of many examples).
I think it makes sense to have 2 pairs of commands, one shall pad with zeros, another shall not.
And no need to implement fancy rules to determine, when to use padding.
P.S. This may be better discussed in a separate thread, but currently padding works only for positive numbers, e.g. decrement from 10 gives 09, while increment from -10 gives -9.
The text was updated successfully, but these errors were encountered:
maximbaz
changed the title
Make padding with zeros optional
Implement 2 pairs of inc/dec commands: one shall pad with zeros, another shall not
Jan 5, 2015
I think I've implemented this in the padding-tests branch of my fork. It has evil-numbers/inc-at-pt-pad and evil-numbers/dec-at-pt-pad that preserve padding (consistently for negatives too, I think), where the original functions do not preserve it.
I'm pretty sure it still has some kinks to work out, though.
Edit: pulled into master of my fork, for now. I think most if not all of the "kinks" were present even before my changes.
My fork has this. There is a variable evil-numbers/padDefault (off by default), which enables or disables padding globally and in addition every command takes an optional padded argument, so you could easily make a commands inc-at-pt-pad and inc-at-pt-nopad.
@cofi, out of curiosity, what was the rationale behind this decision?
I'm sure there are pros and cons in both approaches, and padding doesn't always suit as well (see @mlf176f2's PR for just one of many examples).
I think it makes sense to have 2 pairs of commands, one shall pad with zeros, another shall not.
And no need to implement fancy rules to determine, when to use padding.
P.S. This may be better discussed in a separate thread, but currently padding works only for positive numbers, e.g. decrement from
10
gives09
, while increment from-10
gives-9
.The text was updated successfully, but these errors were encountered: