cybersemics / em

A beautiful, minimalistic note-taking app for personal sensemaking.
Other
261 stars 88 forks source link

Set cursor on first non-meta thought on paste #2050

Open raineorshine opened 2 weeks ago

raineorshine commented 2 weeks ago

Steps to Reproduce

  1. Create a thought a
  2. With the cursor on a, paste the following text:
- =note
  - test
- b

Current Behavior

The cursor is moved to =note on paste.

Expected Behavior

The cursor should be set on b.

The cursor should be set on the first sibling that is not a metaprogramming attribute when state.showHiddenThoughts is false.

Testing

Add importText tests for showHiddenThoughts true and false.

Notes

The logic for where the cursor is set on import is here: https://github.com/cybersemics/em/blob/5ffafd3a22beb062ff2b55b87115fe898aea7870/src/actions/importText.ts#L192