fix(coc): correct pum col for concealed characters#5590
fix(coc): correct pum col for concealed characters#5590fannheyward wants to merge 5 commits intomasterfrom
Conversation
e498eea to
90da16b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5590 +/- ##
==========================================
- Coverage 97.91% 97.91% -0.01%
==========================================
Files 280 280
Lines 27927 27927
Branches 5791 5791
==========================================
- Hits 27346 27344 -2
Misses 111 111
- Partials 470 472 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@A4-Tacks give this a test |
There was a problem hiding this comment.
Pull request overview
This PR fixes incorrect popup menu (pum) horizontal positioning when completion happens on lines containing concealed text (and other display-width-affecting characters), addressing issue #5582 by switching to screen-cell–accurate column calculations.
Changes:
- Use
screenpos()to compute the pum’s horizontal offset using actual on-screen columns (so conceal/wide chars don’t skew placement). - Add a fallback path to the prior
strdisplaywidth()-based calculation whenscreenpos()yields invalid positions.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This doesn't work |
90da16b to
92e478b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This works correctly in Perhaps we should judge This fix also caused a misalignment of |
fixed |
|
Poor 1 error Expect Actual |
04a4f9b to
b0b1f86
Compare
|
When the line is too long (out of columns), the pum position at the end of the line is incorrect There are two situations, |
any screenshot? |
|
It seems that nothing has been fixed in this commit, including the |
2026-04-01_1775015534212.mp4 |
4157ad5 to
1554cec
Compare
Closes #5582 Use screenpos() on neovim to compute the screen column offset between the completion start and cursor, avoiding incorrect results when concealed text is present. For vim, add s:screen_col() that walks characters with synconcealed() to account for conceal replacements when computing the screen column position.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1554cec to
9e3d314
Compare
|
Incorrect, what about you? |
|
@A4-Tacks should be fixed on wrap/nowrap cases |
|
Still incorrect, perhaps this is too difficult? |
|
The wrap/nowrap cases: if you first input If no |




Closes #5582
This fix was made by Codex with GPT-5.4