Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recalculate horizontal scrollbar width #18

Open
minesworld opened this issue Jan 13, 2025 · 1 comment
Open

Recalculate horizontal scrollbar width #18

minesworld opened this issue Jan 13, 2025 · 1 comment

Comments

@minesworld
Copy link

On start the scollbar is set to a width of 2000 . This will show the horizontal scrollbar even on empty editors.

The horizontal scollbar max value gets adjusted when the text will exceed this value. But it won't readjust to lower values when the max lines width is shortened.

The correct behaviour would be to set the max scrollbar value depending on the actual max line length.

@minesworld
Copy link
Author

minesworld commented Jan 13, 2025

The easiest is the first step - set the default width to 1 instead of 2000. But: its gets complicated after that as there seem to be many codepaths when the scrollbar gets updated. But it is somehow "unclear" when which internal values will be calculated so that the real width of the horizontal scrollbar can be set...

Like some function to set the scrollbar are called more than once during a single update (like on keypress). Maybe it makes sense to update the scrollbars only via the timer callback?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant