Saving file loses code from yank buffer
Swizec opened this issue · 3 comments
When I yank code (C-w) and save the file, it clears my yank buffer so I can't paste said code in a different file.
Steps to reproduce:
- Have JavaScript
- Mark some code
- C-w
- C-x C-s
- Open different file
- C-y
Observe nothing gets pasted.
My setup:
(require 'prettier-js)
(defun enable-minor-mode (my-pair)
"Enable minor mode if filename match the regexp. MY-PAIR is a cons cell (regexp . minor-mode)."
(if (buffer-file-name)
(if (string-match (car my-pair) buffer-file-name)
(funcall (cdr my-pair)))))
(require 'web-mode)
(add-to-list 'auto-mode-alist '("\\.jsx\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.js\\'" . web-mode))
(add-hook 'web-mode-hook #'(lambda ()
(enable-minor-mode
'("\\.jsx?\\'" . prettier-js-mode))))
For full .emacs.d dir you can see here: https://github.com/Swizec/dot.emacs.d
I'm pretty sure this is happening here.
I probably won't be able to take care of this for a while. If this really bothers you, it would be great if you could you give it a try and send a PR 😃
Thanks!
@rcoedo I secretly don't know how ELisp works. I cobble my config together from README files like yours 😃
I can give it a try one or two weekends from now if it annoys me enough. Thanks for finding the line where it happens!
I've been using this patch ☝️ for the past three weeks and it works fine.