fix: virtual text on wrapped/long lines #136

Open
wutwere wants to merge 1 commit from wutwere/main into main
wutwere commented 2025-04-21 01:37:06 -04:00 (Migrated from github.com)

The existing position calculation for virtual text in CompletionPreview:render_standard(...) fails when lines are longer than the width of the window (i.e. the screen starts scrolling horizontally with nowrap, or when the line wraps). Currently, when this happens, the virtual text is simply rendered outside of the screen and can not be seen.

This PR fixes the issue by using the cursor position rather than the position returned by virtcol(".").
This enables virtual text to actually be visible when lines are long.

The existing position calculation for virtual text in `CompletionPreview:render_standard(...)` fails when lines are longer than the width of the window (i.e. the screen starts scrolling horizontally with nowrap, or when the line wraps). Currently, when this happens, the virtual text is simply rendered outside of the screen and can not be seen. This PR fixes the issue by using the cursor position rather than the position returned by `virtcol(".")`. This enables virtual text to actually be visible when lines are long.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin wutwere/main:wutwere/main
git switch wutwere/main

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff wutwere/main
git switch wutwere/main
git rebase main
git switch main
git merge --ff-only wutwere/main
git switch wutwere/main
git rebase main
git switch main
git merge --no-ff wutwere/main
git switch main
git merge --squash wutwere/main
git switch main
git merge --ff-only wutwere/main
git switch main
git merge wutwere/main
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
supermaven-inc/supermaven-nvim!136
No description provided.