yatli / fvim

Cross platform Neovim front-end UI, built with F# + Avalonia
MIT License
1.34k stars 30 forks source link

FVimFontLineHeight '0' will freeze or hang process sometimes #70

Closed nree closed 5 years ago

nree commented 5 years ago

I don't know why anyone would want 0 line height, but I see this issue when testing out the other issues.

Expected: Line height goes to 0, everything looks weird. Can still use / input.

What happens: Sometimes it freezes, can not input or see any render, but can close normally. Sometimes the process hangs and cannot input anything and need to terminate process (ctrl alt del).

Reproduce:

  1. Need to open decent size file, I use fvim/ui.fs
  2. (Optional) Have decent line height already :FVimFontLineHeight 'default'
  3. Set line height 0 :FVimFontLineHeight '0' Sometimes will freeze, sometimes will hang Sometimes will work (this is only true if file isn't big enough for me)

Btw I have decent speed machine (Ryzen 3600, 16GB memory, geforce 1050)

Not big deal because I don't think anyone would set line height to 0 on purpose. But maybe bug appears for real values but the difference in line height is too big?

nree commented 5 years ago

Did more test:

+30.0 -> -10.0 = OK +30.0 -> -30.0 = BAD

So even real values that are huge still ok, only really big ones that no one would do are bad. But probably need to confirm with someone with lower spec computer?

yatli commented 5 years ago

added a few guards to line height so it should be fixed now.

nree commented 5 years ago

🏄‍♂️

works better than before. no crash, and can handle +50.0 -> -50.0 more smooth now, no hang.