Open tomtomjhj opened 1 year ago
Hmm this completely breaks everything. For example, with fdm=expr, :w
should update the fold, but it doesn't. I guess win_execute also suppresses stuff related to updating folds.
Fixed. Turns out that some of the side effects in the old code were crucial for triggering the recomputation of the fold. So it should be triggered explicitly.
Hello, thanks for the additional fixes according to your recent force push. Somehow the diff is not very helpful anymore, could you quickly summarize what changed?
This PR reduces side effects in s:WinDo() (e.g., CursorMoved) by replacing :windo with win_execute(). The tricky part is that setting options in win_execute() doesn't trigger fold recomputation. IIRC the force pushes were various attempts to achieve this. The final solution is to call foldlevel(). Here is the version that is cleaner but breaks compatibility: https://github.com/tomtomjhj/FastFold/commit/cecb798b46ab22c0d974763f66e5741368822224
However, the problem in nvim that motivated this change has been fixed, so I'm no longer interested in this patch.
Problem: The current implementation of
s:WinDo()
fails at avoiding some side effects. Specifically,:windo
and:wincmd w
triggerCursorMoved
even ifnoautocmd
is used (both in Vim and Nvim ≥ 0.10). This makes nvim's lsp hover window immediately close.Solution: Use
win_execute()
if it's available.update: in neovim, cursormoved is no longer fired for temporary movements https://github.com/neovim/neovim/pull/24675