cofi / evil-numbers

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

0xB not recognized as a number #2

Closed hpdeifel closed 12 years ago

hpdeifel commented 12 years ago

0xB or any hexadecimal number with 'B' in it is not recognized, if the cursor is on the 'B'.

evil-numbers probably mistakes the B for the start of a binary number.

cofi commented 12 years ago

I can't reproduce.

0xB --- inc-at-point ---> 0xC 0xB --- dec-at-point ---> 0xA

What does not work is, when the cursor is before the B (i.e. on 0 or x), this should work though. Can you provide more information?

hpdeifel commented 12 years ago

On Di, Okt 30 2012, Michael Markert wrote:

I can't reproduce.

0xB --- inc-at-point ---> 0xC 0xB --- dec-at-point ---> 0xA

What does not work is, when the cursor is before the B (i.e. on 0 or x), this should work though. Can you provide more information?

That's strange. I did this:

start emacs -Q (require 'evil) (require 'evil-numbers) (evil-mode) insert 0xB position cursor on B call evil-numbers/inc-at-pt

I then get the message "No number at point or until end of line"

I use the latest git versions of evil and evil-numbers and GNU Emacs 24.2.1.

I also think it can't work, because of this line in evil-numbers/search-number:

;; being on a specifier is handled in progn (not (looking-at "[bBoOxX]"))

cofi commented 12 years ago

My fault, because I use a bar cursor I seemingly did not have the same notion of the position. Anyway: I think you are spot on. Right now I think that this case is useless but triggers in this rare case the bug.

I'll have to run some more tests and release a new version if this is indeed the case, but that won't happen until the weekend.

Workaround till then: Position the cursor after the B.

Thanks for the report!