Copy to Clipboard of Comments are not correct, are they?

Hi Folks,

i just noticed that copying a mps line-comment to the clipboard (and pasting in a text-editor) removes all spaces...

Thing is, that i came up with my own documentation concept using the jetbrains.mps.lang.text Lang concept. Same here... all the spaces/tabs are removed when copying content to clipboard.

How can i work around that behaviour?

Cheers,

Daniel

 

0
15 comments

Hi Daniel,

this looks like a bug. If it helps, you can select the content of the comment (leaving out the actual "//" or "/* ... */" symbols) and spaces will be preserved.

Vaclav

0

Hi Vaclav,

yes, speaking of my extended concept, i can use SHIFT for selecting the content, then copying it. That will preserve the content. However, using Control-W (expand selection) selects the my whole concept, resulting in the problem.

Is there no workaround? Overwriting a method or so? Copy-Paste handlers or similar functionality?

 

Dan

 

0

Not really, unfortunately. The Copy-Paste handlers have no impact on the textual representation of the nodes that is stored in the clipboard. It is all about how the EditorCells render themselves as text.

The default copy-paste implementation does not correctly renders the Word's editor to text due to the two "constant" cells around the actual word value. I'll see if the mechanism can be made more clever or customized for the comments.

Vaclav

0

Cheers Vaclav,

 i ll use an intention until then ...

0

Proper copy/cut action handlers have been implemented and will be available in 2022.2

0

Hi Vaclav,

that s amazing! Cheers !

0

Hi Vaclav,

just realized that the paste action on comments ist also not correct. The new-lines are ignored. So i came up with two intentions as a workaround. Do you think it s worth fixing that also? Everything else seems to be correct - just the newlines are missing ... 

 

0

Hi Daniel,

can you be more specific how to reproduce the problem with pasting new lines, please? I'd love to have this functionality perfect.

Vaclav

 

0

Hi Vaclav,

when pasting text copied from another text editor, the new-lines get not pasted correctly. I tried to copy a text with multiple lines, all the content get s pasted, but solely in one single line. I reproduced that also in /* multiline comments

Dan

0

Weird. Which version of MPS?

0

Ok, I see. In 2021.3 this has already been fixed.

0

Nice ... Sorry for disturbing you ... 

0

No problem. Thank you for pushing the feature to its limits.

0

Happy times ...

0

Please sign in to leave a comment.