mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-03-23 09:51:16 +01:00
While investigating issue #2 I was able to reproduce it and view the panic that causes the komorebi process to become non-responsive. When switching to a columnar layout (which is the default for the 2nd workspace in the sample ahk config), there is the possibility to cause a divide by zero panic if the len passed to Layout::calculate is 0. I have remedied this by changing the type of len from usize to NonZeroUsize, and also by ensuring that Layout::calculate is only called from within the komorebi crate if the workspace has at least one container. While moving containers around I also noticed that creating a new container for a window may also cause a panic if focused_idx + 1 is greater than the length of the VecDeque of containers, so this was addressed by pushing to the back of the VecDeque in that case. re #2