vim-patch:9.1.1817: popup: there are some position logic bugs (#36075)

Problem:  popup: there are some position logic bugs
Solution: Refactor position logic and fix a few bugs
          (Girish Palya).

This change does the following:

- Simplified and rewrote horizontal positioning logic (was overly
  complex).
- Split horizontal and vertical positioning into separate functions.
- Fixed missing truncation marker (e.g. `>`) when items were truncated
  and `pummaxwidth` was not set.
- Fixed occasional extra space being added to menu items.
- Update tests

closes: vim/vim#18441

e3ed5584ed

Cherry-pick pum_display_{rtl,ltr}_text() changes from patch 9.1.1835.

Co-authored-by: Girish Palya <girishji@gmail.com>
This commit is contained in:
zeertzjq
2025-10-08 13:47:50 +08:00
committed by GitHub
parent f67306cc67
commit c881bc537e
5 changed files with 263 additions and 297 deletions

View File

@@ -757,11 +757,11 @@ describe('ext_multigrid', function()
## grid 3
{7:-- Keyword Local completion (^N^P) }{15:match 1 of 2} |
## grid 4
{24: foo}|
{21: bar}|
{24: foo }|
{21: bar }|
]],
float_pos = {
[4] = { -1, 'NW', 2, 15, 55, false, 100, 1, 15, 55 },
[4] = { -1, 'NW', 2, 15, 43, false, 100, 1, 15, 43 },
},
}
feed('<C-E><Esc>')