nakst/gf

[feature request] Horizontal scrollbars

flysand7 opened this issue · 4 comments

I'm debugging a project that has very long lines that don't fit on my screen even if I made gf window as big as my screen. There's no option to enable wrapping of lines or scroll the window, which is a lot of inconvenience.

s4my commented

I second this. This is a basic thing any scroll area should have (the command output comes to mind as well). But am not so sure if luigi (UICode i think to be precise) has this ability right now ?

nakst commented

Commit 2245028 adds horizontal scroll bar support to UICode with the flag UI_CODE_H_SCROLL.
Although I'm undecided as to whether this should actually be used in the source code window or the console.

s4my commented

Commit 2245028 adds horizontal scroll bar support to UICode with the flag UI_CODE_H_SCROLL. Although I'm undecided as to whether this should actually be used in the source code window or the console.

Nice, you should remove the if condition in https://github.com/nakst/gf/blob/master/luigi2.h#L2845 (we don't need the UI_CODE_H_SCROLL flag, which means you probably gonna need to amend the last commit to something like "added horizontal scrollbar support for UICode"):

-	if (flags & UI_CODE_H_SCROLL) code->hScroll = UIScrollBarCreate(&code->e, UI_SCROLL_BAR_HORIZONTAL);
+ 	code->hScroll = UIScrollBarCreate(&code->e, UI_SCROLL_BAR_HORIZONTAL);

This way all the UICode elements will dynamically show the horizontal scrollbar if the window size is too small to display all of it's contents. We want the same behavior as vScroll 👍🏻

nitpick: can you put them next to each other ?
code->vScroll = UIScrollBarCreate(&code->e, 0);
code->hScroll = UIScrollBarCreate(&code->e, UI_SCROLL_BAR_HORIZONTAL);
s4my commented

i just noticed another visual enhancement, at this point i might as well just make a pull request for my proposed suggestion.