ylc395 / joplin-plugin-note-link-system

A complete Link System for Joplin. Referrer(aka. backlink), Quick Link, Copy Anchor, Hover To Preview, and much more feature
154 stars 5 forks source link

Bug: cursor position wrong for notes without sections #6

Closed shinglyu closed 2 years ago

shinglyu commented 2 years ago

I set the option Quick Link: What Happen After Completion to Move cursor to link end.

Normally if I type @@ and input a note name, a sections dropdown list will come up. If I don't want to link to a section I press ESC and the cursor will move to the end of the link. I'll illustrate below

  1. Type@@My Note 1, select one note. The markdown will look like:

    [My Note 1](:/12345abced|)
                            ^-- cursor position
    1. If the note has any sections, a dropdown will be shown.
    2. If I don't want to link to a specific section, I press ESC. Then the cursor will move out of the brackets:
      [My Note 1](:/12345abced)|
                            ^-- cursor position

    However, if the notes doesn't have any sections. The dropdown in step 2 will not be shown, and they cursor will be stuck at the position in step 1.

    In this situation, I'd expect the cursor to go directly to the position in step 3.

ylc395 commented 2 years ago

fixed in 0.5.1

shinglyu commented 2 years ago

@ylc395 Thank you for fixing it so quickly!!