Multiline selection does not follow cursor upwards

Bug report

When using multi-line cursor selections ctrl+shift+up or ctrl+shift+down the viewport only follows the cursor corretly one way. So when selecting multiple lines downwards the viewport correctly follows the cursor such that it is always in view, this does not happen when selecting upwards, see gif below.

gif

Environment

  • Platform: Windows
  • Platform version: 11
  • App Version: 5.4.3

How to reproduce

  1. Have the cursor be on a line in a note document with more lines that can fit in view
  2. Press ctrl+shift+down enough times to reach a line that would have been out of view originally
  3. See the viewport follow such that the cursor is still in view
  4. Go back to a single selected line/cursor
  5. Press ctrl+shift+up enough times to reach a line that would have been out of view originally
  6. See the viewport incorrectly not follow the cursor such that you now can not see which line the cursor is on

Hi Magnus,

Thanks for the report.
It looks like a bug in CodeMirror:

I’ll update it to the latest version in the next release.

Landed in v5.5.0 :tada:
Thanks again for the report!

The update does not seem to have completely resolved the issue. Now when multiline selecting upwards it does follow the cursor until the multiline cursor fills the number of lines that fill the whole viewport, meaning that the cursor still disappears out of view in top. But when doing the same it does follow the cursor downwards.

To test this try.

  1. Place the cursor in the middle of the viewport
  2. Use the multiline selection upwards enough to reach the top of the viewport
  3. Use the multiline selection upwards enough to fill the whole viewport and see the top still being kept in view
  4. Continue and now see the top disappearing out of view
  5. Do these steps again but now multiline selection downwards and see the cursor being kept in view in step 4

Thanks for the report.
Ah makes sense. So, it looks like CodeMirror only scrolls for the primary cursor or something.
Since Inkdrop itself does nothing to do with this behavior, it’d be a bug of CodeMirror.
Would you mind reporting it to them?
Once it gets fixed, I would be happy to update it!