Delete and yank commands with a 0 in the count argument are parsed incorrectly
erganemic opened this issue · comments
Issue Description:
When evil-org-mode
is active in a buffer, all delete and yank commands (and possibly others I haven't tried yet) which have a digit argument that contains a 0 are interpreted incorrectly.
Here's a short list of some commands and how they're incorrectly parsed:
User inputs | Emacs reads |
---|---|
d 10 k |
C-u 62 k |
d 10 j |
C-u 62 j |
d 20 j |
C-u 72 j |
d 30 j |
C-u 82 j |
d 100 j |
C-u 620 j |
d 102 j |
C-u 622 j |
y 10 j |
C-u 83 j |
y 20 j |
C-u 93 j |
y 30 j |
C-u 103 j |
This means that if you try and e.g. delete 10 lines below point, you instead jump 62 lines below point without deleting anything.
As you can see, there are patterns to the integers in the right column, depending on whether the command was a delete or yank and where the first 0 appears, but I haven't been able to figure out the logic behind them yet.
To reproduce:
Run emacs -Q -l init.el
with the following init.el
file:
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(package-refresh-contents)
(unless (package-installed-p 'evil)
(package-install 'evil))
(require 'evil)
(evil-mode 1)
(unless (package-installed-p 'evil-org)
(package-install 'evil-org))
(require 'evil-org)
(add-hook 'org-mode-hook 'evil-org-mode)
(require 'evil-org-agenda)
(evil-org-agenda-set-keys)
In any buffer where evil-org-mode
is enabled, try a delete or yank command like one of the ones listed above; you should be able to see what it's being interpreted as in the echo area. If you're in a file with enough lines, try d 10 j
and you should jump 62 lines down without deleting anything.
For reference, this behavior first appeared on an Arch Linux VM running Emacs version 27.2, but I've been able to recreate it on a Macbook running Catalina and the same Emacs version, and at least one other person I've brought this up to has experienced it as well.
What I've tried:
Commenting out the sexp starting at this line seems to fix this issue (asides from the obvious problem of removing the evil-org-beginning-of-line
binding). However, I'm not sure why - the code is free of any obvious defects, and indeed looks similar to what evil itself does.
I thought maybe evil had changed something since this package was last updated, but I checked out an old commit of evil, from before the last commit to this repo, and the issue persisted.
Any help would be appreciated; I'm super interested in figuring out why this is happening and what's going on.
The above issue in evil
is the root cause of this problem; since it isn't a result of anything in this particular package, I'm closing the issue.