Disable paste transient state when multiple cursors are active
evil-mc has no support for the 'paste transient state', hence we should fall back to the default version during that period.
This commit is contained in:
parent
bf2892b198
commit
58458f2d2a
|
@ -107,12 +107,28 @@
|
||||||
(use-package evil-mc
|
(use-package evil-mc
|
||||||
:defer t
|
:defer t
|
||||||
:init
|
:init
|
||||||
;; remove emc prefix when there is not multiple cursors
|
(progn
|
||||||
(setq evil-mc-mode-line
|
(defun spacemacs-evil/evil-mc-paste-after (&optional count &optional register)
|
||||||
`(:eval (when (> (evil-mc-get-cursor-count) 1)
|
(interactive "p")
|
||||||
(format ,(propertize " %s:%d" 'face 'cursor)
|
(if (and (eq (evil-mc-get-cursor-count) 1) dotspacemacs-enable-paste-transient-state)
|
||||||
evil-mc-mode-line-prefix
|
(spacemacs/paste-transient-state/evil-paste-after)
|
||||||
(evil-mc-get-cursor-count)))))))
|
(evil-paste-after count register)))
|
||||||
|
|
||||||
|
(defun spacemacs-evil/evil-mc-paste-before (&optional count &optional register)
|
||||||
|
(interactive "p")
|
||||||
|
(if (and (eq (evil-mc-get-cursor-count) 1) dotspacemacs-enable-paste-transient-state)
|
||||||
|
(spacemacs/paste-transient-state/evil-paste-before)
|
||||||
|
(evil-paste-before count register)))
|
||||||
|
|
||||||
|
(define-key evil-normal-state-map "p" 'spacemacs-evil/evil-mc-paste-after)
|
||||||
|
(define-key evil-normal-state-map "P" 'spacemacs-evil/evil-mc-paste-before)
|
||||||
|
|
||||||
|
;; remove emc prefix when there is not multiple cursors
|
||||||
|
(setq evil-mc-mode-line
|
||||||
|
`(:eval (when (> (evil-mc-get-cursor-count) 1)
|
||||||
|
(format ,(propertize " %s:%d" 'face 'cursor)
|
||||||
|
evil-mc-mode-line-prefix
|
||||||
|
(evil-mc-get-cursor-count))))))))
|
||||||
|
|
||||||
;; other commenting functions in funcs.el with keybinds in keybindings.el
|
;; other commenting functions in funcs.el with keybinds in keybindings.el
|
||||||
(defun spacemacs-evil/init-evil-nerd-commenter ()
|
(defun spacemacs-evil/init-evil-nerd-commenter ()
|
||||||
|
|
Loading…
Reference in a new issue