Skip to content

Commit

Permalink
fix(evil-mc): move and fix evil-escape integration
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Nov 1, 2023
1 parent cbf53a7 commit 8cc883d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 44 deletions.
40 changes: 0 additions & 40 deletions modules/extras/me-evil-mc-evil-escape.el

This file was deleted.

25 changes: 21 additions & 4 deletions modules/me-multi-cursors.el
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,28 @@
(ess-smart-comma (:default . evil-mc-execute-call))
(evil-digit-argument-or-evil-beginning-of-visual-line
(:default . evil-mc-execute-default-call)
(visual . evil-mc-execute-visual-call)))))
(visual . evil-mc-execute-visual-call))))

(use-package me-evil-mc-evil-escape
:after evil-mc evil-escape
:demand t)
(with-eval-after-load 'evil-escape
(defun +evil-mc-evil-escape-move-back-fake-cursors ()
(unless (bolp) (backward-char)))

(advice-add
'evil-escape-func :before
(defun +evil-mc--evil-escape-fix-a ()
(when (evil-mc-has-cursors-p)
(evil-mc-pause-cursors)
(run-with-idle-timer
0 nil
(lambda ()
(evil-mc-resume-cursors)
(let ((evil-mc-command '((:name . +evil-mc-evil-escape-move-back-fake-cursors))))
(evil-mc-execute-for-all)))))))

(add-to-list
'evil-mc-custom-known-commands
'(+evil-mc-evil-escape-move-back-fake-cursors
(:default . evil-mc-execute-default-call)))))

(use-package evil-multiedit
:straight t
Expand Down

0 comments on commit 8cc883d

Please sign in to comment.