Sublime Forum

Bug with show_at_center (ctrl-l)

#1

Open a large file.
Press Ctrl-L for show_at_center, several sequential keypresses.
The window scrolls up or down around every time show_at_center is called. Sometimes it cycles through 2 or 3 positions iteratively. It seems random and arbitrary the way it is scrolling.

Contrast this with how Ctrl-L works in Emacs (and which seems the correct way)
the first Ctrl-L results in the active line being exactly vertically centered in the screen.
Subsequent Ctrl-L presses does not move the scroll from that exact centered position (no jumping around)

0 Likes

#2

Depends which version of emacs. But I agree with you.

So I have implemented this Control-L behavior with the additional not-as-well-known emacs behavior that if you give it a numeric argument, it puts the line with point at the numeric argument line on the screen.

So for example, Meta-0 Control-L moves your current line to the top line in your window.

Of course, this also implies that I have implemented Emacs style numeric arguments (Meta-[0-9], Control-U, Meta–, etc).

I’ve also implemented a proper emacs kill-ring. Not quite ready for prime time as this is my first weekend with Sublime but I am confident I can make sublime do what I want to do, for the most part anyway.

0 Likes