Closed ychin closed 6 years ago
Thanks for reporting the issue. I pushed a commit, please test. https://github.com/markonm/traces.vim/commit/e27b2a515989282122bd24eae8e16b05dbe9265e
I tested the commit (e27b2a5) and didn't see any issues! Thanks for fixing.
Repro
I have found that whenever using traces, a split window that's currently "minimized" (i.e. having 0 height) would open themselves after the highlight (e.g.
:%s/foo/bar
). A simple repro below after opening a new Vim instance with a fresh .vimrc:The fourth line would trigger traces' highlight code, and expand the first window which has been minimized.
Ideas
Digging through the code, it seems like the issue comes from the spurrious
win_gotoid()
calls froms:highlight()
andtraces#cmdl_leave()
. Each time the script enter a new window viawin_gotoid
, ifwinheight
is larger thanwinminheight
, the window will get expanded causing this bug.It seems to me a simple way to fix this is to not visit the other windows, maybe through a setting called
g:traces_only_current_window=1
that will only update the current window instead of the other ones too. Also the following lines may have to be re-thought as well:Other option may be to make sure to restore the proper heights of each window. That seems more error prone to me but it would allow us to keep the existing functionality of updating multiple windows.