The error message: (wrong-type-argument integer-or-marker-p nil)
Is shown if grI or grA is pressed before a selection has been made after starting Emacs.
Reproduction guide :beetle:
start Emacs
open the scratch buffer
press grI or grA
Observed behaviour: :eyes: :broken_heart:
evil-mc-make-cursor-in-visual-selection: Wrong type argument: integer-or-marker-p, nil
Expected behaviour: :heart: :smile:
A message could be shown:
evil-mc-make-cursor-in-visual-selection-beg: Only works with a selectionevil-mc-make-cursor-in-visual-selection-end: Only works with a selection
Something like this:
(message "%s: Only works with a selection" this-command)
calls: (count-lines evil-visual-beginning evil-visual-end)
but before a selection has been made then both variables:
evil-visual-beginning and evil-visual-end are nil.
System Info :computer:
evil-mc-20191124.538
GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-08-29
Windows 1903
Description :octocat:
The error message:
(wrong-type-argument integer-or-marker-p nil)
Is shown ifgrI
orgrA
is pressed before a selection has been made after starting Emacs.Reproduction guide :beetle:
grI
orgrA
Observed behaviour: :eyes: :broken_heart:
Expected behaviour: :heart: :smile: A message could be shown:
evil-mc-make-cursor-in-visual-selection-beg: Only works with a selection
evil-mc-make-cursor-in-visual-selection-end: Only works with a selection
Something like this:
Cause
The function: https://github.com/gabesoft/evil-mc/blob/ef22ee1a9d9a82a9b954f27f82ddcb7cb0f634ec/evil-mc-cursor-make.el#L477
calls:
(count-lines evil-visual-beginning evil-visual-end)
but before a selection has been made then both variables:evil-visual-beginning
andevil-visual-end
arenil
.System Info :computer:
evil-mc-20191124.538 GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-08-29 Windows 1903