abo-abo / lispy

Short and sweet LISP editing
http://oremacs.com/lispy/
1.19k stars 129 forks source link

C-7 add three cursors instead of two #637

Closed QiangF closed 1 year ago

QiangF commented 1 year ago

It happens with the following package version (latest from melpa)

GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.17.6) of 2022-09-12

lispy-20220912.529

multiple-cursors-20220821.932

QiangF commented 1 year ago

The fix can be found here https://github.com/knu/mc-extras.el/blob/master/mc-freeze.el

(defun lispy-cursor-down (arg)
  "Add ARG cursors using `lispy-down'."
  (interactive "p")
  (require 'multiple-cursors)
  (if (and (mc/all-fake-cursors)
           (not (eq last-command
                    'lispy-cursor-down)))
      (progn
        (deactivate-mark)
        (mc/remove-fake-cursors))
      (if (lispy-left-p)
          (lispy-dotimes arg
            (mc/create-fake-cursor-at-point)
            (cl-loop do (lispy-down 1)
                     while (mc/all-fake-cursors (point) (1+ (point)))))
          (mc/mark-lines arg 'forwards))
      (mc/maybe-multiple-cursors-mode)
      ;; Prevent the fake cursors from moving via mc's post-command-hook
      (setq this-original-command nil)))
QiangF commented 1 year ago

OK, we can simply add (unsupported-cmd lispy-cursor-down "lispy cursor down")