gabesoft / evil-mc

Multiple cursors implementation for evil-mode
MIT License
387 stars 36 forks source link

Failed to execute all ... with error: Wrong type argument: number-or-marker-p, nil #23

Closed fleimgruber closed 8 years ago

fleimgruber commented 8 years ago

evil-mc-20160222.1452 from MELPA

Steps to reproduce: In the *scratch* buffer, with 10 lines containing "asdf", after a couple of evil-mc-make-and-goto-next-match and then an evil-backward-word-begin, only the last cursor moves backward one word.

Debug log is

evil-mc There are 2 cursors matching "\_<asdf\_>"
evil-mc Command evil-mc-make-and-goto-next-match 
evil-mc There are 3 cursors matching "\_<asdf\_>"
evil-mc Command evil-mc-make-and-goto-next-match 
evil-mc There are 4 cursors matching "\_<asdf\_>"
evil-mc Command evil-mc-make-and-goto-next-match 
evil-mc There are 5 cursors matching "\_<asdf\_>"
evil-mc Command evil-mc-make-and-goto-next-match 
evil-mc There are 6 cursors matching "\_<asdf\_>"
evil-mc Command evil-mc-make-and-goto-next-match 
evil-mc There are 7 cursors matching "\_<asdf\_>"
evil-mc Command evil-mc-make-and-goto-next-match 
evil-mc There are 8 cursors matching "\_<asdf\_>"
evil-mc Command evil-mc-make-and-goto-next-match 
evil-mc There are 9 cursors matching "\_<asdf\_>"
evil-mc Command evil-mc-make-and-goto-next-match 
evil-mc There are 10 cursors matching "\_<asdf\_>"
evil-mc Command evil-backward-word-begin b
evil-mc Record-begin ((:undo-list-pointer-pre nil (k . -210) (k . -211) (210 . 212) undo-tree-canary) (:evil-state-begin . normal) (:keys-pre-with-count nil evil-backward-word-begin [98] nil) (:keys-pre . [98]) (:name . evil-backward-word-begin))
evil-mc Record-finish ((:undo-list-pointer-post nil (k . -210) (k . -211) (210 . 212) undo-tree-canary) (:keys-post-raw . [98]) (:keys-post . [98]) (:last-input . 98) (:evil-state-end . normal) (:undo-list-pointer-pre nil (k . -210) (k . -211) (210 . 212) undo-tree-canary) (:evil-state-begin . normal) (:keys-pre-with-count nil evil-backward-word-begin [98] nil) (:keys-pre . [98]) (:name . evil-backward-word-begin)) evil-backward-word-begin
evil-mc Record-done evil-backward-word-begin pre b post b keys-motion  keys-operator  count nil keys b
evil-mc Execute evil-backward-word-begin for all cursors
evil-mc Execute evil-backward-word-begin with evil-mc-execute-default-call-with-count [2 times]
evil-mc Failed to execute all evil-backward-word-begin with error: Wrong type argument: number-or-marker-p, nil
gabesoft commented 8 years ago

What version of evil do you have? You should upgrade to 1.2.10 if you haven't already.

fleimgruber commented 8 years ago

Thanks for the prompt feedback. yep, evil-1.2.10 from MELPA stable.

gabesoft commented 8 years ago

That's weird I was getting the same error after upgrading to the latest version of evil. And I thought I fixed it with this commit 69b7d31a527e86ad02932ef2d30ae9870c913050 Maybe try deleting both evil & evil-mc from the elpa folder and re-install

gabesoft commented 8 years ago

The tests pass too, so this looks like a version mismatch ...

fleimgruber commented 8 years ago

Hmm. I uninstalled and reinstalled evil-1.2.10 and evil-mc-20160222.145, went with an emacs -Q and after

(require 'package)
(package-initialize)
(require 'evil)
(require 'evil-mc)
(evil-mode)
(global-evil-mc-mode 1)

and repeating the steps in my first post, now I see

Debugger entered--Lisp error: (void-variable evil-this-type-modified)
  evil-inner-symbol()
  evil-mc-set-pattern()
  evil-mc-find-and-goto-match(forward t)
  evil-mc-make-and-goto-next-match()
  call-interactively(evil-mc-make-and-goto-next-match nil nil)
  command-execute(evil-mc-make-and-goto-next-match)
gabesoft commented 8 years ago

Hmm... Ok, I'll try to see if I can reproduce that

gabesoft commented 8 years ago

This is kind of weird but I followed the exact steps as you with emacs -Q and I'm not able to get the same error you're getting. Seems to work fine for me ... :(

gabesoft commented 8 years ago

I'm not sure if this would make a difference but I'm on a mac and my Emacs version is 24.5.5

gabesoft commented 8 years ago

From your stack trace though it seems that evil-inner-symbol throws an error. Maybe try running that function directly just to see if it works.

gabesoft commented 8 years ago

In particular it seems that evil-this-type-modified is not defined. But, it should be defined in evil-vars.el in the evil code.

fleimgruber commented 8 years ago

I did not find evil-this-type-modified in the evil-vars.el or the upstream stable branch of evil...

Anyways, I took the leap of faith and installed the MELPA unstable versions of my selection of evil-* packages... This bug disappeared, so good to close from my side.