mirror of
https://github.com/neovim/neovim.git
synced 2026-04-25 00:35:36 +00:00
fix(pum): info float width grows on reselect with 'linebreak' #38680
Problem: win_linetabsize() includes wrap overhead from 'linebreak' based on current window width, but the result sizes the window, causing a feedback loop. Solution: Temporarily set w_view_width to Columns before measuring.
This commit is contained in:
@@ -2142,15 +2142,19 @@ describe('builtin popupmenu', function()
|
||||
eq(1, n.eval([[len(uniq(copy(g:bufnrs))) == 1]]))
|
||||
end)
|
||||
|
||||
it('handles tabs in info width calculation', function()
|
||||
it('handles tabs and "linebreak" in info width calculation', function()
|
||||
screen:try_resize(50, 11)
|
||||
command([[
|
||||
set linebreak
|
||||
set cot+=menuone
|
||||
let g:list = [#{word: 'class', info: "\tClassName() = default;"}]
|
||||
]])
|
||||
feed('S<C-x><C-o>')
|
||||
local info = fn.complete_info()
|
||||
eq(30, api.nvim_win_get_width(info.preview_winid))
|
||||
feed('<C-N><C-P>')
|
||||
info = fn.complete_info()
|
||||
eq(30, api.nvim_win_get_width(info.preview_winid))
|
||||
feed('<ESC>')
|
||||
exec([[
|
||||
setlocal tabstop=1
|
||||
|
||||
Reference in New Issue
Block a user