Closed lvimuser closed 2 years ago
I don't think I fully understand what's going on here. We aren't changing position of cursor and setting winbar option in autocommad shouldn't change position of cursor.
I think this might be caused by an upstream bug. I'll have to look into that. Since winbar is still only available only on nightly some bugs are too be expected I've actually found several already while working on the winbar feature for lualine. See if you can reproduce this issue without lualine.
The patch you've given is halting update of statusline & winbar while you're in a floating window. That's not what we want as the statusline & winbar of other windows should still update even if you're in floating window. It's also odd that it fixes the issue since you don't need floating window to reproduce it.
I think this only happens when the cursor is at the last character/column.
First, I thought it was 'ModeChanged' being triggered inside that buffer, however, it's also triggered on nvim --clean
.
I wonder if https://github.com/vim/vim/issues/10780 might be related? (but the issue occurs on lualine on nightly and on 1a2560c2dc
which is before the ml_get
patch).
I don't think I fully understand what's going on here. We aren't changing position of cursor and setting winbar option in autocommad shouldn't change position of cursor.
I have no idea either, so I can't provide more info.
I think this might be caused by an upstream bug. I'll have to look into that. See if you can reproduce this issue without lualine.
Do you any ideas? I couldn't repro with nvim --clean -u __init.lua a.lua
then source script.lua
(tested on nightly and 1a2560c2dc
).
The patch you've given is halting update of statusline & winbar while you're in a floating window. That's not what we want as the statusline & winbar of other windows should still update even if you're in floating window.
yea that makes sense
fixed in 2d6108e07f5888a42dee37598570bac990ca1297
Self Checks
How to reproduce the problem
Enable winbar.
Expected behaviour
Cursor doesn't change position/assert doesn't fail.
Actual behaviour
Cursor is off by one, assert fails.
Minimal config to reproduce the issue
script
Aditional information
NVIM v0.8.0-dev-666-g1a2560c2dc
Possible culprits:
It doesn't appear to happen if I run
lua vim.api.nvim_del_augroup_by_name('lualine_wb_refresh')
though, so it might be a winbar only issue.Found when trying to scroll completion docs with nvim-cmp (scroll docs) https://github.com/hrsh7th/nvim-cmp/blob/main/lua/cmp/view/docs_view.lua#L115-L130. It's annoying bc the cursor moves, triggering completion again, but on the wrong char.
The following patch fixes it, but i'm not familiar with the codebase. It also solves winbar flickering when calling
vim.lsp.buf.hover()
. (related https://github.com/nvim-lualine/lualine.nvim/issues/751)Checking for each 'win' inside the filter is not sufficient.