zxlive icon indicating copy to clipboard operation
zxlive copied to clipboard

Easy copy-pasting between ZXLive and Tikzit

Open jvdwetering opened this issue 1 year ago • 2 comments

Currently when you ctrl+C a piece of diagram, it is stored internally and not on the clipboard. This means it is not possible to copy-paste in between zxlive and tikzit. If this is a desirable feature then this could be implemented in the following ways:

  • Instead store the graph data in the clipboard as tikz code that tikzit can understand. This is a very clean solution, but it has the drawback that if we add other stuff to diagrams that we want to be copyable that this then also has to be representable as tikz code.
  • Have a dedicated button or keyboard shortcut for 'export to clipboard as tikz' and 'import from clipboard as tikz'.

While a little bit more to remember, I think the second one is probably the better way to go. If it turns out that switching between zxlive and tikzit is something that a lot of users want to do we can still promote it to be the default ctrl-c, ctrl-v behaviour.

jvdwetering avatar Oct 10 '23 12:10 jvdwetering

A potential third option would be that when you ctrl-c, it saves it both as an internal copy and to the clipboard so that you can still export things to tikzit from zxlive. The clipboard version could then contain less information then the full internal copy.

The drawback of this approach would be that if we also want to support pasting into zxlive, then we need some logic to determine whether to copy from the clipboard or from the internal copy.

jvdwetering avatar Oct 10 '23 12:10 jvdwetering

In the commit 2267ba9 I implemented it such that copying to clipboard is Ctrl+Shift+C while pasting from the clipboard is Ctrl+Shift+V. We might decide that eventually we only want to support copying to the clipboard. I could imagine that the current behaviour would be surprising to users.

jvdwetering avatar Nov 08 '23 19:11 jvdwetering