-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
org-paste-subtree inserts empty line above paste #16274
Comments
Hmmm this sounds like a package issue to me when I am honest, can you go ahead and try to reproduce the issue on a vanilla emacs first? I don't think that we have any custom org paste functions implemented. |
I had tested it in vanilla emacs (see date above) and it was not reproducible there. But it does happen in a fresh spacemacs installation. |
;; Remove the forced level indicator.
(when (and force-level (not level))
(delete-region (line-beginning-position) (point)))
;; Paste before the next visible heading or at end of buffer,
;; unless point is at the beginning of a headline.
(unless (and (bolp) (org-at-heading-p))
(org-next-visible-heading 1)
(unless (bolp) (insert "\n"))) So the behaviour observed above could be due either to a mismatch in the Org versions, or to the presence or absence of newline characters at the end. |
Thanks for sharing this observation and testing again with plain emacs. However, regarding that I tested with plain emacs 2022, I don't think this was due to an old version. Regarding a newline character after
It is enough that
|
Thanks, I can reproduce your observations. For me, the behaviour in Spacemacs and I found a thread corresponding to your issue on the Org mailing list, and it has just been fixed. In my tests it also works well with the default behaviours of the evil cursor. I would expect the fix to be included in the next Org release, presumably 9.6.28. |
Description
When pasting a subtree into an empty heading (line starting with some
***
, which can be used to set the level of the pasted tree) withorg-paste-subtree
, an empty line is inserted above the inserted subtree.I would expect no new line to be inserted, and I think this was the behaviour before I noticed this.
The value of
org-blank-before-new-entry
is((heading) (plain-list-item))
, which should mean no empty lines. And I think it is this variable which worked before, but stopped working (already in 2020-01, where I noticed the problem).This does not seem to be a bug in org-mode itself, as it does not happen in plain emacs (tested 2022-09).
In case it is related, and someone takes a look at it, I'd like to mention that it sometimes happens that more then the last cut/yanked subtree is pasted, namely subtree(s) from below the yanked or something that was in the kill ring already (if I recall correctly).
Reproduction guide 🪲
Fresh spacemacs installation with evil mode and minimal packages
Copy (yank) the following
and paste (
org-paste-subtree
) at position "_" here:It does not matter whether in insert mode or navigation mode (using evil).
Observed behaviour: 👀 💔
Expected behaviour: ❤️ 😄
System Info 💻
The text was updated successfully, but these errors were encountered: