Open svermeulen opened 10 years ago
Thanks for reporting, I'll look into this. When windows get squished, their scroll changes so I try to use winsaveview()
and winrestview()
to work around this issue, but there must be a bug with it.
I also noticed that this issue occurs when creating a new tab. The following fixes that:
autocmd WinEnter * normal! 80zh
But doesn't address the problem outlined above when creating new splits (since it's the previous window with the bad scroll not the new one)
Found a better workaround in the function accordion#Accordion
"jump to prevwin and back so that window history is preserved
execute prevwin "wincmd w"
normal! 100zh
execute curwin "wincmd w"
normal! 100zh
Obviously a bit hacky though.
Thanks, that helps. My main things to consider are if this alienates people that had the view intentionally scrolled to the right. I'd also need to ensure that the solution works with any number of windows and accordion size. If the best end solution still feels a bit hacky though, worst case, I make it an optional setting.
The biggest source of frustration for me with this plugin is that often times I'll open a new vertical split only to find that the previous split I was in has been scrolled to the point where I can't really see the text I was working with, forcing me to jump back to the previous split and adjust the horizontal scroll.
Repro steps:
set nowrap
AccordionAll 2
:vsp [path to test file]
AccordionStop
:vsp [path to test file]