Two major improvements:
1) see through scrollbars when not hovered.
2) un-scrollable line numbers.
Also enlarged display region by eliminating padding. There is still a
problem with lines jumping when the scrollbar is dragged but it is
limited to one line and probably due to floating point error for scroll
bar number. It is much less noticeable than the previous jumping which
could involve several pages.
---------
Co-authored-by: WerWolv <werwolv98@gmail.com>
The top margin changes when popups block some portion on the screen.
Previously it was implemented adding blank lines at the bottom which
created problems if the windows was scrolled all the way to the bottom
and the popups were issued. The newer implementation doesn't use spaces
and simply resets the top of the window to be higher making the popup
interaction with the window more natural (no text disappears on the
lines the popup overlaps the text). changes can be identified form the
variables mTopMargin,mOldTopMargin and mNewTopMargin.
Unfortunately those changes revealed problems in cursor navigation that
needed to be addressed. Namely, the window will scroll up and down on
the line before last/second line at the top and similar problems for the
left and right. Those changes correspond to the function
EnsureCUrsorVisible()
Fixing those reveled yet more problems with scrolling past the end of
the file using the keyboard which required adding some more variables
and functions to support the correct handling, You find those changes in
the function MoveDown.
I also renamed some variables that had the wrong casing and fixed the
pasting but that is missing one line.
The reason for the error were the text preprocessor added to deal with
tabs was created to process entire files, not just lines or words. In
that context it cleaned trailing new lines if any existed but in the new
role that's not only unwanted but erroneous.
### Problem description
After that was fixed the console started to add two empty lines between
each output line. When splitting a string using new lines you need to
not add a new line to the last line created. Even if the text ends in an
end line, the split screen code is set to not discard empty lines.
### Implementation description
The fixes are straightforward.
I have implemented a fix that makes the scrollbars behave like they do
in VScode. Vertically you can scroll past the end of the file until only
the last line can be seen at the top. The horizontal bar behaves as if
every line was the same length which is the length of the longest line
in the file. Not only this creates a better user experience, but it also
fixes the annoying flicker that occurs when scrolling through large
files. Also, I have switched all the old draw calls to render text to
regular TextUnformatted calls which adds extra stability to the
resulting display.
To implement the behavior I added a dummy widget with the desired
dimensions.
This time it may be for good.
### Implementation description
As requested I added the preprocessing functionality into the pattern
editor. I had to duplicate a few functions and update the c++ library to
version 20. but now I can make sure the pattern editor doesn't see a tab
again. I also removed the preprocessor from where it was before because
it is not needed anymore. The changes were tested using a file that used
tabs for all its white space. The file was pasted into the pattern
editor and imported as well. I both cases no crashes occurred and the
files had no tabs on them.