Fixes#366
The comment in the Swift code explains what was happening here:
> I don't know if this is the right place, but because of WindowAccessor in our
> SwiftUI hierarchy, we have a reference cycle between view and window and windows
> are never freed. When the window is closed, the window controller is deinitialized,
> so we can use this opportunity detach the view from the window and break the cycle.
An alternate solution would be to make our reference back to the window
"weak" but we appear to not be able to do that with SwiftUI property
wrappers such as `@State` and `@Binding` and so on.
This is a weird one. By using intCast on the `idx` I am periodically
getting a panic on index out of bounds where the index is larger than
FontIndex can possibly be. Very strange!
I tried to just remove intCasts and believe it or not that worked.
Previously, `cat /dev/urandom` would trigger the issue in seconds and
now I've had it running 20+ minutes without the issue.
The additional `if` check is just a safety mechanism
Fixes#362
We previously tried to parse 4-form 48, but as far as I can tell this is
never used anyways and in this real world scenario it expected us to
parse a 3-form followed by an underline. This fixes the real world
scenario as priority and adds a test.
This also fixes an issue where single form colon underline may actually
exist, again from a real world scenario.
Fixes#359
See #359 for a test script. The unit tests were also wrong. I used the
test script in #359 to verify the exact column that tabstops should be
set at.
Fixes#143
There were multiple issues with the previous calculation. First, we
expected dash width COULD be negative and protected against it, but our
dash width calculation type was unsigned! With the proper font metrics,
this led to an underflow safey panic.
Second, as part of the dash width calculation, we are tryign to downstep
the size of the gaps so we can try to fit dashes within a cell. But we
were not using those adjusted gap sizes. With the proper font metrics,
this could lead to an assertion failure seen in #143.
This fixes the calculations. They produce the same numbers, but do so in
a more Zig-idiomatic way while fixing the above two issues.