Opening a file at its last line does not match going to the last line
Summary
Opening a file with hx +999999 positions the last line of the file in the center of the window. I expect it to act like g e, respecting scrolloff.
P.S. I am trying to configure Helix as a scrollback-editor in Zellij. Ideally, the text should change as little as possible from the scrollback when opening it in Helix. Currently, the text jumps drastically due to the above-mentioned centering.
Reproduction Steps
- Open a file with enough text to fill a page using
hx +999999.
Helix log
Log is empty.
Platform
Linux
Terminal Emulator
alacritty 0.12.3
Installation Method
Nixpkgs
Helix Version
helix 23.10 (f6021dd0)
A man accepts!
We always center when jumping or opening at a location. In the long run I think this could be solved with scripting a command on startup to do ge but in the meantime I don't want to add a special case for this and introduce inconsistency
We always center when jumping or opening at a location. In the long run I think this could be solved with scripting a command on startup to do
gebut in the meantime I don't want to add a special case for this and introduce inconsistency
Actually, jumping to the last line with 999999G, or any other number equal to or greater than the number of lines, does not center. I cannot reproduce the behavior of hx +999999 without manually centering using zc. The + option seems to be the inconsistency here.
I'm saying that any time we open a location - from pickers for example but also any LSP motion, :open, etc. - we center. Motions like j or G are different, they move the cursor and the view moving is just a consequence of keeping the cursor in view