Vim mode: `gj` at the end of a file jumps to another part of the file

UPDATED

Steps to reproduce

  1. help vault, turn on vim mode
  2. Create the following untitled note
  1. position cursor after the first heading and before “some more text”

  2. Press gj 2x

CleanShot 2022-10-18 at 10.38.15

Expected result

Cursor is positioned at the bottom of the file.

Actual result

Cursor jumps to above the heading but below the first line

Environment

SYSTEM INFO:
	Obsidian version: v1.0.1
	Installer version: v0.15.9
	Operating system: Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000 21.6.0
	Login status: logged in
	Catalyst license: vip
	Insider build toggle: on
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none

Additional information

This happens in both Live Preview and Source mode.

I believe this used to only happen with transcluded blocks at the end of a file pre-1.0.0

There are recent fixes for gj in the 1.0.1 release that appear to unlock this jumping behavior in all cases.

1 Like

I saw this is also being discussed in Discord. Are you testing 1.0.1 already in alpha? I can’t reproduce this in 1.0.0, but while testing, I noticed if I move the cursor with the mouse it gets weird, and maybe it’s also related, or maybe 2 separate problems.

If I move the cursor with the mouse, gj and gk seem to remember where the cursor was before the mouse move, and moves to there instead.

Related bugs:

1 Like

Are you testing 1.0.1 already in alpha?

yes

If I move the cursor with the mouse, gj and gk seem to remember where the cursor was before the mouse move, and moves to there instead.

Oh interesting.

In previous versions of Obsidian (0.16x and on I think) I could only trigger this jumping behavior on gj around transclusions at the end of a file. With 1.0.1, it happens always.

The previous bug around bullets, transclusions, and gj movement still exists in 1.0.1

1 Like

from v1.0.1 insider build release notes

  • Vim: Fixed gj and gk not working.

Confirmed gj and gk are working except for the jumping behavior at the end of a file.

Only with inline title activated. When inline title is off, the cursor won’t move to the last visual line if the second to last visual wrapped line is longer than the last one.

I only have inline title enabled in sandbox (default of course).

With inline title deactivated, gj jumps to the second-to-last line for me, so repeated gj’s jump back and forth between the last and second-to-last lines.
CleanShot 2022-10-20 at 13.19.41

And also this new bug I just made, based on my reply above. Still isn’t fixed. I considered replying here, but figured I’d be asked to make a new one.

will be fixed 1.0.3

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.