mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
refactor(evil): replace evil-visual-update-x-selection advice
With the new evil-visual-update-x-selection-p setting. Also adds a more descriptive comment to this design choice.
This commit is contained in:
@ -63,11 +63,15 @@ directives. By default, this only recognizes C directives.")
|
||||
:config
|
||||
(evil-select-search-module 'evil-search-module 'evil-search)
|
||||
|
||||
;; stop copying each visual state move to the clipboard:
|
||||
;; https://github.com/emacs-evil/evil/issues/336
|
||||
;; grokked from:
|
||||
;; http://stackoverflow.com/questions/15873346/elisp-rename-macro
|
||||
(advice-add #'evil-visual-update-x-selection :override #'ignore)
|
||||
;; PERF: Stop copying the selection to the clipboard each time the cursor
|
||||
;; moves in visual mode. Why? Because on most non-X systems (and in terminals
|
||||
;; with clipboard plugins like xclip.el active), Emacs will spin up a new
|
||||
;; process to communicate with the clipboard for each movement. On Windows,
|
||||
;; older versions of macOS (pre-vfork), and Waylang (without pgtk), this is
|
||||
;; super expensive and can lead to freezing and/or zombie processes.
|
||||
;;
|
||||
;; UX: It also clobbers clipboard managers (see emacs-evil/evil#336).
|
||||
(setq evil-visual-update-x-selection-p nil)
|
||||
|
||||
;; Start help-with-tutorial in emacs state
|
||||
(advice-add #'help-with-tutorial :after (lambda (&rest _) (evil-emacs-state +1)))
|
||||
|
Reference in New Issue
Block a user