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

Crashes when use hCenter, hLimit, and vBox together. #52

Closed
sifmelcara opened this issue May 5, 2016 · 3 comments
Closed

Crashes when use hCenter, hLimit, and vBox together. #52

sifmelcara opened this issue May 5, 2016 · 3 comments

Comments

@sifmelcara
Copy link
Contributor

The following program crashes when the terminal width is less than max (min hlim a) (min hlim b), and this happens both when the initial terminal size is too small and when I manually resize terminal width after program start.

import Brick
import Brick.Widgets.Center

ui :: Widget
ui = hCenter . hLimit hlim $ vBox [s a 'A', s b 'B']
    where
    s x c = str . take x $ repeat c
    hlim = 100
    a = 60
    b = 40

main :: IO ()
main = simpleMain ui

The error I got is Main.hs: row 0 now exceeds region width.

Not sure if this is a duplicate of #47 .

@jtdaugherty
Copy link
Owner

Thanks for the report and for the test program! I'll take a look in the next few days when I get some time.

@jtdaugherty
Copy link
Owner

I've pushed a fix in 5ed4955. This behavior could come up in a few different settings and it should now be avoided in all cases. Care to try this against your own project? Once you're satisfied, feel free to close this issue (or let me know what else I can do).

Thanks!

@sifmelcara
Copy link
Contributor Author

Yes, the commit fixed the problem. Thank you.

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

2 participants