Rem properties are not preserved when copying and pasting

Briefly explanation with gif:

Steps to reproduce

  1. turn off the following feature in the settings as shown in the image
  2. Create a rem with these properties → backward + descriptor
  3. copy that rem
  4. paste to the new line
  5. as you can see rem properties is not preserved

relevant github link:

have you tried attempting this with some characters on the front side of the descriptor?

yes, the problem continues

Edit: Below of this post is probably not right. See my new post.

For me:

The following are preserved:

  • remtype (descriptor etc.)

The following are not preserved:

  • direction of practice
  • tags

Here is how I would specify the correct behavior (i.e. what would be intuitive for me).

There are 2 different copy behaviors that logically should behave differently. (They are actually doing the same ATM.) With “logically” I mean what seems sensible for a software to do given the input data and not necessarily what a non-technical user might expect.

  1. Copying (all) text from a rem and pasting (shown by @Eiko in the first post).
    • Think of this as putting the markdown of the copied text into the clipboard.
    • This should insert the formatted text into the currently focused rem just by interpreting the markdown, i.e. use the default CD-Framework conventions (uppercase → concept in both directions etc.), not add any tags since the copied text did not contain any, but preserve any inline formatting (bold etc.) since the markup is included in the copied text.
  2. Copying the whole rem (shown by @ako in the 4th post).
    • Think of this as putting the whole rem including all metadata into the clipboard.
    • This should generate new rem below the currently focused one as an exact duplicate of the copied rem preserving all information including rem type, practice direction, tags and powerup tags.
    • If the current rem is empty (ignoring whitespace) it should be replaced instead of added below.
    • It is debatable if all powerups should be preserved: For example Edit Later might be an exception?

I think 2. behaves like 1. because rem duplication is internally implemented as just interpreting the text content of the rem ATM.

(Note that the rem type is also not preserved. It’s just a conincidence when sticking with the CD-Framework convention.)

Ther are also these copy&paste glitches which should not happen in 2.:

  • There is an extra space after formatted text intervals (here bold, but also highlight etc.)
  • There are 2 spaces before the pasted content. They are actually trimmed when unfocusing the rem, but they should not be there in the first place.

Side question: Are there cases where one would want leading, trailing whitespace? I can not think of one. So always trimming whitespace seems to be fine?

1 Like

I can’t think of any use case of the white space :zipper_mouth_face:

I agree that the current behavior is not so intuitive and there should be 2 different copy and paste behavior.

However, I suggest these 2 different bahavior should be selected when pasting, not copying.

There are two reasons:

  1. You can’t select only texts of multiple rems in the current implementation.

  2. If my guess is right, there is actually no difference between the ways to copy a rem done by @Eiko and me.

Hopefully, 1 is obvious so I don’t explain.

Explanation for reason 2

About reason 2, @hannesfrank expressed my way to copy a rem shown in this post as “Copying the whole rem”. I guess one of the reason @hannesfrank thought so is that “Ctrl + A” behavior is a little confusing.

Current Ctrl + A behavior

In the current implementation, “Ctrl + A” selects things depending on how many times “Ctrl + A” is pressed:

  • 1st time: Select a rem

  • 2nd time: Select a rem and its children

  • 3rd time: Select the all rems on the page

Confusing point of Ctrl + A

The confusing point is rem’s bullet point is not highlighted the 1st time, while they’re hightlighted the 2nd and 3rd time.

If a rem don’t have any children, the only difference from the 1st time to the 2nd time is that a bullet point is hightlighted. This difference seems to imply that “selecting the all text of a rem” and “selecting a whole rem” are different, but in reality, this behavior happens just because the highlights correspond to “Select a rem” and “Select a rem and its children”. So this behavior doesn’t imply “selecting the all text of a rem” and “selecting a whole rem” are different, I guess.

Things I newly found.

The following are always not preserved.

  • Direction of pratice

  • Remtype

Tags are preserved if:

  • a rem is “pasted normally” (not using Ctrl + Shift + V or the like) and is pasted with its parent.

My suggestions

  • “Ctrl + V” to preserve metadata, “Ctrl + Shift + V” to not preserve metadata.

  • Metadata to preserve are direction of practice, remtype, tags and text format.

  • Power-ups is debatable.