gabesoft/evil-mc

cursors from selection doesn't work before a first selection has been made

Closed this issue · 0 comments

Description :octocat:

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 🪲

  • start Emacs
  • open the scratch buffer
  • press grI or grA

Observed behaviour: 👀 💔

evil-mc-make-cursor-in-visual-selection: Wrong type argument: integer-or-marker-p, nil

Expected behaviour: ❤️ 😄
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:

(message "%s: Only works with a selection" this-command)

Cause

The function:

(defun evil-mc-make-cursor-in-visual-selection (beg)

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 💻

evil-mc-20191124.538
GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-08-29
Windows 1903