Determining the maximum line width and thus the scroll bar size may be a very slow operation. To avoid slowness, the scroll bar is not automatically shrunk to fit.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think that Scintilla could attempt to do that. It could check the file size and only adjust the scroll bar when the file isn't very big. It could also stop after x lines or the operation could timeout.
Most files aren't very big, so computing this shouldn't impact performance much.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
An additional choice could be added to SetScrollWidthTracking if a viable implementation were contributed.
The first step would be designing how this would work such as whether every document change requires a full restyle and measure. What priority does the measurement have over other background tasks? If there is a timeout then what happens when the operation times out?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Determining the maximum line width and thus the scroll bar size may be a very slow operation. To avoid slowness, the scroll bar is not automatically shrunk to fit.
I think that Scintilla could attempt to do that. It could check the file size and only adjust the scroll bar when the file isn't very big. It could also stop after x lines or the operation could timeout.
Most files aren't very big, so computing this shouldn't impact performance much.
An additional choice could be added to SetScrollWidthTracking if a viable implementation were contributed.
The first step would be designing how this would work such as whether every document change requires a full restyle and measure. What priority does the measurement have over other background tasks? If there is a timeout then what happens when the operation times out?