HOW TO REPRODUCE:
Copy a text block y in the opened buffer.
Move to another file via treemaps and open it in place of the previous buffer.
Messages buffer writes somewhat:
Saving file /home/andrey/.emacs.d/.cache/treemacs-persist...
Wrote /home/andrey/.emacs.d/.cache/treemacs-persist
Try to paste copied text block p:
You paste Project name.
Not sure if it can be reproduced 100% times, but appears really often and annoys hard
Cannot reproduce. Some really weird is going on here.
Saving file /home/andrey/.emacs.d/.cache/treemacs-persist...
That only happens if something changes with your projects, when one is added, removed or a position is changed.
You paste Project name.
And that only happens when you call treemacs-copy-project-root which is bound to yr.
So yeah, what version of spacemacs and treemacs are you on, what keys do you press and what does your config look like.
https://github.com/Antiarchitect/.dotfiles/blob/master/.spacemacs
Spacemacs is latest develop branch treemacs layer updates with it.
It's enough to open file from one project, select and copy block with y, SPC-0 back to Treemacs, go to another project, open file with o-o in place of the old, and try to paste with p. I'm pretty sure I don't press r during this procedure.
Let's get a tie breaker, and ask other spacemacs+treemacs users: @duianto, @TimoFreiberg - can you guys do me the favor and see if you can reproduce this?
It seems to be working as expected.
With two projects defined Treemacs (both cloned from their github repositories):
helmspacemacs-theme SPC q RSPC f thelm-adaptive.elyy the first line:;;; helm-adaptive.el --- Adaptive Sorting of Candidates. -*- lexical-binding: t -*-
SPC 0spacemacs-theme) C-jC-l (Ctrl and lowercase L)spacemacs-common.el o opThe copied line from the first file is inserted after the second files first line
;;; spacemacs-common.el --- Color theme with a dark and light versions.
;;; helm-adaptive.el --- Adaptive Sorting of Candidates. -*- lexical-binding: t -*-
(autohotkey colors emacs-lisp git helm html ibuffer markdown multiple-cursors org spell-checking treemacs version-control)
Can't reproduce either.
I used the same commands as you guys.
Emacs 26.1, Archlinux, Spacemacs develop
I'm using l (Lowercase L) to open subfolders and navigate into, h - to move to parent - seems habit from Neotree. Use j to move down, and k for up. Don't use C-j C-l
Confirmed.
One doesn't have to copy anything, the kill-ring gets entries just by navigating with h or l (lowercase L).
With a project called project that has a subdir dir1.
kill-ring from the Eval: prompt (S-M-;)(setq kill-ring nil)
kill-ring is a variable defined in ‘simple.el’.
Its value is nil
project as root, select the subdir dir1dir1 with l
The kill-ring now contains:
Value:
(#(" project
" 0 1
(img-unselected #2=(image :type png :file "c:/Users/username/.emacs.d/elpa/26.1/develop/treemacs-20190204.1821/icons/root.png" :scale 1 :ascent center :background "#292b2e")
img-selected
(image :type png :file "c:/Users/username/.emacs.d/elpa/26.1/develop/treemacs-20190204.1821/icons/root.png" :scale 1 :ascent center :background "#212026")
display #2#)
2 9
(button
(t)
category default-button face treemacs-root-face :project #s(treemacs-project "project" #1="c:/project")
:symlink nil :state root-node-closed :path #1# :depth 0))
#("kill-ring is a variable defined in ‘simple.el’.
Its value is nil
" 0 36
(yank-handler #1=(evil-yank-line-handler nil t))
36 45
(help-args
(kill-ring "c:/Users/username/Applications/emacs-26.1-x86_64/share/emacs/26.1/lisp/simple.el")
category help-variable-def-button button
(t)
yank-handler #1#)
45 65
(yank-handler #1#)))
project with h
The kill-ring contains:
Value:
(#(" dir1" 0 1
(img-unselected
(image :type png :file "c:/Users/username/.emacs.d/elpa/26.1/develop/treemacs-20190204.1821/icons/root.png" :scale 1 :ascent center :background "#292b2e")
img-selected #2=(image :type png :file "c:/Users/username/.emacs.d/elpa/26.1/develop/treemacs-20190204.1821/icons/root.png" :scale 1 :ascent center :background "#212026")
display #2#)
2 6
(button
(t)
category default-button face treemacs-root-face :project #s(treemacs-project "dir1" #1="c:/project/dir1")
:symlink nil :state root-node-closed :path #1# :depth 0)))
I'm using
l(Lowercase L) to open subfolders and navigate into,
You should've said so from the start. With this info I've found the culprit.
Lesson of the day: Don't use kill-whole-line if you don't want to pollute the kill-ring. Use something like (delete-region (point-at-bol) (1+ (line-end-position))) instead.
I'll be dropping a patch tomorrow.
Guys, I'm very new to emacs/spacemacs (but I'm in love though) so didn't understand a single word. But patch sounds great to me!
@Antiarchitect Welcome. Don't worry you'll learn the more you use it. 😺
@Alexander-Miller The fix seems to be working, the kill-ring isn't modified after changing the root up or down. Thanks 👍
Most helpful comment
You should've said so from the start. With this info I've found the culprit.
Lesson of the day: Don't use
kill-whole-lineif you don't want to pollute the kill-ring. Use something like(delete-region (point-at-bol) (1+ (line-end-position)))instead.I'll be dropping a patch tomorrow.