Vim `gj` at the end of a file teleports cursor to the top

After the latest update (I guess it was 1.13.6), the behavior of the Vim gj motion has changed. It is very similar to this old bug, but it behaves differently: when you press gj while the cursor is in the middle of a line (do not matter how many lines you above the end) and you repetitively press gj, at the end of the file cursor will jump back to the top.

Steps to reproduce

  1. Open a Sandbox Vault
  2. Go to Settings > Editor > Scroll to the bottom and enable Vim mode (:q to unlock it)
  3. Open any note, for example the Start here one
  4. Scroll to the bottom of the page and place the cursor on the line that contains the text, for example, this one: > If you spot a typo or a mistake, ...
  5. Press ESC to enter Vim Normal Mode
  6. Press l a few times to move the cursor to the middle of the line
  7. Press gj repeatedly until the cursor reaches the bottom of the page
  8. Press gj once more - the cursor teleports to the first line of the note

Notes:

  • If you start pressing gj while the cursor is at the very first character of a line (column 0, or Vim 0 command at a line), the issue does not occur
  • The last line of a file should be empty, otherwise the issue does not occur

I originally noticed this behavior because I am using the obsidian-vimrc-support plugin with j remapped to gj. However, the issue also reproduces in a sandbox vault without any plugins, so it is not plugin‑related.

As far as I can tell, this bug was not present before version 1.13.6, cuz I use j to gj remap for a very long time.

Did you read and follow the Troubleshooting Guide ? [Yes/No]

Yes

Expected result

The gj just should stop the cursor at the bottom of a page

Actual result

It teleports back on top

Environment

Reproduced on Ubuntu 26 and macOS Tahoe 26.

SYSTEM INFO:
Obsidian version: 1.13.7
Installer version: 1.12.7
Operating system: Darwin Kernel Version 25.6.0: Fri Jul 31 19:18:29 PDT 2026; root:xnu-12377.161.14~5/RELEASE_ARM64_T8122 25.6.0
Login status: logged in
Language: ru
Catalyst license: none
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: AnuPpuccin 1.5.0
Snippets enabled: 3
Restricted mode: off
Plugins installed: 9
Plugins enabled: 5
1: Clear Unused Images v1.1.1
2: Templater v2.20.3
3: Custom File Explorer sorting v3.1.6
4: Vimrc Support v0.10.2
5: Style Settings v1.0.9

I can’t reproduce. Download and reinstall Obsidian. Post a screen recording of this happening in the sandbox vault

Here’s the examples, I made a small video on YouTube

did you download and reinstall Obsidian?

Ok, I can reproduce the problem.