Make cut & paste preserve node id so that internal links are not broken

Right now I am using the following methods to “Move” a node:

  1. Drag&Drop with mouse from source to target
  2. using “Move to…” action (from context menu or shortcut)
  3. Cut a node (CTRL+X) from source and Paste (CTRL+V) at target location

All of them have their up- and downsides:

  1. Drag&Drop
    upside: does not break [[links]]
    upside: works well when source and target location are close to each other
    downside: can not use it if source and target are far apart (too inconvenient)

  2. “Move to…”
    upside: does not break [[links]]
    upside: good if source and target are far apart
    downside: hard to define the exact target location (ex. to end? start? somewhere in the middle?)

  3. Cut&Paste
    upside: works well regardless if source and target location are close or far away
    upside: can define exact target location (position of pasting)
    downside: breaks [[links]]

The last one (Cut&Paste) is the most convenient to use. I always use it if I know nothing links to the source node. If I know the source node is being linked to, I try to use the other 2 options.

My feature request
Could you make Cut&Paste also not breaking [[links]] like the move actions do?

Potential solution

  • You could add metadata to the clipboard, which is used to make pasting a node as if it has been moved (aka not breaking [[links]]), ex. having the node id in the clipboard metadata
  • Since it’s possible to paste a content multiple times, I would suggest to start making copies of the nodes after the first “Paste” (aka if the node ids to paste are already in the document). So if the user decides to Cut&Paste&Paste&Paste, existing links will link to the first pasted nodes.
  • If there are links to “child” nodes, those should also not break

Thanks for the detailed feature request, and especially for going over your use case, that was super helpful!

The difficulty with your proposed solution is, as you can probably tell, how to make sure the id is unique. Otherwise, data inconsistency might even lead to sync problems.

I’ve renamed the feature request (I hope you don’t mind!) to state the benefit, and we’ll see if other users are interested in this as well! If so, that gives us more reason to go ahead with it.

Thanks again!

Cutting and pasting should not break internal links and neither should the creation date be changed! Standard computing operations in many programs!

1 Like

I am starting to use node links more and more, but I fear I will accidentally break them over time by using Cut&Paste :cry:

Maybe the unique id / sync problem can be addressed by the fact, that the changes done inside the same client are guaranteed to be in sync.
In other words, the clipboard could store the “client id” (or session id) in addition to the nodes, and as long as you paste it into a client with the same client id you are good.
If you paste it (for whatever reason) inside another client (which might not have synced yet), it will make copies of the nodes instead (same as now).