Yes, in MacOS Bear, v2.0.5, I can reproduce it. I just tried it. Note, I’m pasting into VisualStudio Code. You can also reproduce it by selecting “Paste and Match Style” in other apps. I just noticed if I paste it here. in Gmail, with normal paste, it appears correct. If I select “copy-as-plain-text” or “copy-as-markdown” it is wrong. If I select “copy-as-rich-text” or “copy-as-html” it is right.
After some thinking, I realized this is a little controversial. In your case, the expectations are correct but what you got is the effective plain text underneath the Bear representation. In other words, we can remove the folding metadata but I don’t know if this is what everybody will expect on copy.
Hmm. I’m not sure how that would be controversial. It seems to me “if I didn’t type it, it shouldn’t copy it” is a very reasonable expectation. I didn’t know, nor care, that the way Bear represents code folding is by inserting metadata directly in the raw text.
They say you shouldn’t draw conclusions about others from yourself. But if I were to do that, I would not only agree with the quoted argument, but would also assume that everyone else can only have the same expectation.