Cursor moves to beginning of the line in the title if window looses focus

This is one really tricky to reproduce sometimes so try it multiple times (sometimes “pasting” is not even needed). In the explanation below the vertical | bar represents the location of the cursor.

How to reproduce:

  1. Create a new note with this title - leave the cursor at the end of the line: “This is my new note |”
  2. Switch from obsidian to some other app (cmd+tab or alt+tab)
  3. Copy some text (like a word “blah”) into clipboard from somewhere: cmd+c
  4. Switch focus back to obsidian and paste the word “blah” at the end of the title: “This is my new note blah|”
  5. Switch focus away from obsidian again.
  6. Switch back to obsidian
  7. Focus now is at the beginning of the title line: “|This is my new note blah”

I type this:
Screen Shot 2020-11-07 at 5.57.51 PM
Add/paste word “blah”
Screen Shot 2020-11-07 at 5.58.07 PM
After switching to another app and then back to Obsidian, it magically moves the cursor:
Screen Shot 2020-11-07 at 5.58.11 PM

I am running Obsidian 0.9.10 on Mac, but this has happened for last 10 updates/versions of obsidian.

3 Likes

I can reproduce this as well on MacOS. It seems to happen if I paste a word with a space before it. So if I paste " blah" it will do it. If I paste “blah”, it won’t. At least so far, in my tests.

Also if there is a space at the end of the title, or if you have any double spaces, there is a form of auto-correct, which cleans the extra whitespace. When that triggers, then it also jumps back to the beginning of the line.

2 Likes

I can also reproduce this on MacOS (Obsidian 0.9.20).

Regarding my use case: I trigger this regularly because I’m using @nickmilo’s suggested format for sources (S- YYYY - Type - ShortenedTitle - AuthorYear) for which I copy-paste article titles and manually remove whitespaces between words.