fix: use win_execute() to avoid more side effects#74
fix: use win_execute() to avoid more side effects#74tomtomjhj wants to merge 1 commit intoKonfekt:masterfrom
Conversation
|
Hmm this completely breaks everything. For example, with fdm=expr, |
|
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. |
7c7a37a to
c7c7cbf
Compare
* The current implementation of `s:WinDo()` fails at avoiding some side effects. Specifically, `:windo` and `:wincmd w` trigger `CursorMoved` even if `noautocmd` is used (both in Vim and Nvim ≥ 0.10). So use `win_execute()` if it's available. * With `win_execute()`, setting fdm itself doesn't seem to trigger recomputation of fold. Querying the foldlevel seems to be sufficient for triggerring fold recomputation.
|
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: tomtomjhj@cecb798 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,:windoand:wincmd wtriggerCursorMovedeven ifnoautocmdis 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 neovim/neovim#24675