zbirenbaum / copilot-cmp

Lua plugin to turn github copilot into a cmp source
MIT License
1.13k stars 41 forks source link

Ghost text word wrap #74

Closed YodaEmbedding closed 1 year ago

YodaEmbedding commented 1 year ago

Ghost / virtual text should obey the editor's word wrapping settings.

Input:

IT WAS THE BEST OF TIMES,                                | <-- terminal window border

Actual output:

IT WAS THE BEST OF TIMES, it was the worst of times, it w|s the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of light, it was the season of darkness, it was the spring of hope, it was the winter of despair
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
                                 ghost text above        |
                                                         |
                                                         |
                                                         |

Desired output when :set wrap and :set linebreak are set:

IT WAS THE BEST OF TIMES, it was the worst of times, it  |
was the age of wisdom, it was the age of foolishness, it |
was the epoch of belief, it was the epoch of             |
incredulity, it was the season of light, it was the      |
season of darkness, it was the spring of hope, it was    |
the winter of despair                                    |

This is usually only an issue when composing text (in e.g. LaTeX), since sentences often exceed the e.g. 80 character terminal width.

Not sure if this is more of an upstream issue (e.g. nvim-cmp, or neovim).

MunifTanjim commented 1 year ago

It is an upstream issue. Neovim's virtual text doesn't wrap.

YodaEmbedding commented 1 year ago

I'm guessing https://github.com/neovim/neovim/issues/18282 is the relevant issue. Also adjacently related: https://github.com/neovim/neovim/issues/23108

zbirenbaum commented 1 year ago

Closing since problem is upstream and this will work once it has been addressed there