SublimeDebugger
SublimeDebugger copied to clipboard
UI displayed with Sublime Text 4
After upgrading to Sublime Text 4 it could not load the plugin, so I had to remove and install it once again. I re-installed adapters & updated them to the new configuration but UI it's not displaying correctly. In the second picture, it can be seen that tab variables it's showing in the middle of scrolling.

I have this exact display problem since ST3
Just find out the same, on windows, if that matters.
I've also found out that if I change the UI scaling in the settings, from 10, the default, to 9, it fixes this problem, but I also wonder if it is dependandant by the font I'm using in Sublime.
This problem also bothers me
Just find out the same, on windows, if that matters.
I've also found out that if I change the UI scaling in the settings, from 10, the default, to 9, it fixes this problem, but I also wonder if it is dependandant by the font I'm using in Sublime.
When I tried this method, it didn't work
I believe this is fixed already but not released yet.
I don't think I did anything specifically to fix this issue. I don't currently have a Windows setup to test on but there was always an issue with figuring out what the width of a character is on Windows/Linux.
The calculation is done here
https://github.com/daveleroy/sublime_debugger/blob/8f8bbd3273a77ff8b3c4fb09526bac7ef29c0d80/modules/ui/layout_view.py#L148
I was thinking https://github.com/daveleroy/sublime_debugger/commit/b6827cfde5bf457146de42a698fd24d10ae5e48a
I was thinking b6827cf
Oh yeah its probably broken for everyone on the latest dev versions (I'll make a release tonight). I still think there is an issue with the width calculation for some people such as @daniele-niero though.
I was thinking b6827cf
Oh yeah its probably broken for everyone on the latest dev versions (I'll make a release tonight). I still think there is an issue with the width calculation for some people such as @daniele-niero though.
I still have this problem.

@Straw94 did you try adjusting the value here https://github.com/daveleroy/sublime_debugger/blob/8f8bbd3273a77ff8b3c4fb09526bac7ef29c0d80/modules/ui/layout_view.py#L148 mentioned above?
@Straw94 did you try adjusting the value here
https://github.com/daveleroy/sublime_debugger/blob/8f8bbd3273a77ff8b3c4fb09526bac7ef29c0d80/modules/ui/layout_view.py#L148
mentioned above?
I have never adjusted this configuration as I have no experience with python. Can you provide a recommended configuration?
I have never adjusted this configuration as I have no experience with python. Can you provide a recommended configuration?
I would try increasing it a bit and see if the ui width is calculated better so it doesn't wrap the ui
I found that reducing the width a bit, e.g.
if width > 10:
width -= 10
in modules/ui/layout_view.py (line 160) fixes the layout.
Maybe the width calculation isn't accounting for a scroll bar or something and the layout engine finds that there isn't enough room for the third panel and puts it at the bottom.
I found that reducing the width a bit, e.g.
if width > 10: width -= 10in
modules/ui/layout_view.py(line 160) fixes the layout.Maybe the width calculation isn't accounting for a scroll bar or something and the layout engine finds that there isn't enough room for the third panel and puts it at the bottom.
That might work around the issue but rendering the UI at the correct scale is a lot more complicated than it seems like it would be and likely the reason things are not working correctly.
If everything is working correctly we can control the size in characters widths of all the html elements and calculate the actual width in characters that a html element is going to take up. If all of that is working correctly the UI will be reactive and correctly size itself to the given space. To do that requires converting the units used in the generated html and css so they are based on character width instead of height.
If the calculations are off then things take up more or less space than we think in which case some elements will be sized incorrectly and things will not align quite right and in some cases make the phantom (which is sized based on the content inside of it) too large to fit in the given space.
So I spent quite a lot of time on this issue the past weekend and I have workaround that should work well enough.
The root of the issue here is not calculating the width of the panel in characters since that works correctly (I checked). The issue is that to size the UI all of the css/html units need to be converted to character widths and calculating the value to scale those units does not work on Windows/Linux and I do not know why its wrong but it is...
The current calculation (that works on macOS) can be found here if anyone knows why it does not work let me know... https://github.com/daveleroy/sublime_debugger/blob/a9378fcc706d5d0f18670b023862b3a088632ea6/modules/ui/layout.py#L249
The following is the workaround...
Since we know that if the conversion is done correctly the UI will fit pretty much exactly into the space given we can actually just check that it is doing that by comparing the layout and viewport extent of the panel.
If the layout is bigger than the viewport then our conversion value needs to be decreased since the UI is overflowing and if the layout is smaller than the viewport then we need to increase the value. This workaround might take a few iterations before converging on an almost correct value.
The code for adjusting the value can be found here https://github.com/daveleroy/sublime_debugger/blob/a9378fcc706d5d0f18670b023862b3a088632ea6/modules/panel.py#L189
You have to close all files and folders. Then configure view -> layout -> Single. I recommend uninstalling and reinstalling after that process. Reinstall the debugger and accompanying adapter(s). Close and reload sublime text.
I believe this layout issue should be fixed in 0.8.0 but if people still have issues re-open