mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
10.01k stars 714 forks source link

Go past edge of window when line is longer than it #4146

Open lf94 opened 3 years ago

lf94 commented 3 years ago

Feature

When pressing some key, the cursor goes past the edge of the window so you can read the rest of the line.

Usecase

Makes it much easier to read lines which go beyond the window, instead of mashing w or similar.

QuinnFreedman commented 3 years ago

You mean like gl? I'm having trouble envisioning what you mean.

Screwtapello commented 3 years ago

Currently you can view a long line one character at a time with l or vl, or zip right to the end with gl, but if the line is more than one screen wide you'll miss whatever's in-between.

If I edited files with long-lines with any regularity, it might be nice to have a horizontal equivalent of <c-u>, <c-d>, <c-f>, <c-b>.

lf94 commented 3 years ago

@Screwtapello has expressed what I mean perfectly.

caksoylar commented 3 years ago

For reference, Vim has motions like zL and zH (docs) to scroll half a screen width, which is what I used to use.

QuinnFreedman commented 3 years ago

That makes sense. It seems related to #3649 in that it depends on the screen width. I thought earlier i heard that this was a non-starter because of how the internals worked, but it seems like it is available in the %val{window_width} variable. Maybe that could be combined with %val{window_range} or %val{cursor_display_column} to do a version of this as a plugin

QuinnFreedman commented 3 years ago

It's worth noting that kak has the (imo annoying) invariant that the main selection is always on the screen, and you can't have a cursor where there are no characters, so it is impossible to do a version of this that just scrolls the whole screen right because the cursor might be on a short line and would get left behind. But just jumping the cursor to the edge of the window should be relatively easy using the variables above

mawww commented 3 years ago

@QuinnFreedman just as a note, I intend to relax that invariant which I think should only apply whenever we do some modification to the buffer or move the selections.