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

@@ -602,7 +602,7 @@ describe('cmdline', function()
screen:expect([[
|
{1:~ }|*5
{1:~ }{4: loooooooooooooooong quite loooooooooooong, real}|
{1:~ }{4: loooooooooooooooong quite loooooooooooong, rea>}|
:DoubleEntry ^ |
]])
@@ -612,7 +612,7 @@ describe('cmdline', function()
{1:~ }|*3
{3: }|
:DoubleEntry loooooooooooooooong quite loooooooooooong, real|
ly loooooooo{12: loooooooooooooooong quite loooooooooooong, real}|
ly loooooooo{12: loooooooooooooooong quite loooooooooooong, rea>}|
ong entry^ |
]])
@@ -620,7 +620,7 @@ describe('cmdline', function()
screen:expect([[
|
{1:~ }|*3
{3: }{4: loooooooooooooooong quite loooooooooooong, real}|
{3: }{4: loooooooooooooooong quite loooooooooooong, rea>}|
:DoubleEntry ^ |
|*2
]])