YouCompleteMe icon indicating copy to clipboard operation
YouCompleteMe copied to clipboard

Allow soft-wrapping of lines in the signature help window

Open bstaletic opened this issue 1 year ago • 8 comments

PR Prelude

Thank you for working on YCM! :)

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your PR:

  • [x] I have read and understood YCM's CONTRIBUTING document.
  • [x] I have read and understood YCM's CODE_OF_CONDUCT document.
  • [ ] I have included tests for the changes in my PR. If not, I have included a rationale for why I haven't.
  • [x] I understand my PR may be closed if it becomes obvious I didn't actually perform all of these steps.

Why this change is necessary and useful

Fixes #4171

Or at least proposes a fix. Here's a short demo: https://asciinema.org/a/UJlR80blt6OvuwUIqb4swnWUW

This looks ugly, but at least no data is lost due to lines going off screen.


This change is Reviewable

bstaletic avatar Aug 04 '24 13:08 bstaletic

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.88%. Comparing base (f56c0cb) to head (05f688c). Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4252      +/-   ##
==========================================
+ Coverage   89.80%   89.88%   +0.07%     
==========================================
  Files          37       37              
  Lines        4758     4763       +5     
==========================================
+ Hits         4273     4281       +8     
+ Misses        485      482       -3     

codecov[bot] avatar Aug 04 '24 14:08 codecov[bot]

Right, the shifting to the left is broken in this pull request. Let's leave it for now and maybe I'll get back to it during the weekend.

bstaletic avatar Aug 16 '24 07:08 bstaletic

Thank you for working on this. Today I was searching for how to enable this feature only to find out that it doesn't exist yet.

hippie68 avatar Aug 27 '24 16:08 hippie68

I'll be getting back to this pull request, this week. My idea is to only set wrap when the popup is all the way left in column 1. We'll see how that goes.

bstaletic avatar Sep 11 '24 01:09 bstaletic

I think I got this working. @hippie68 would you mind trying this branch/patch?

bstaletic avatar Sep 11 '24 04:09 bstaletic

This latest update works well for me. I tested it with those overly long Python function signatures, which now wrap properly. It works like I would have expected YouCompleteMe's signature help window to work out of the box.

hippie68 avatar Sep 11 '24 16:09 hippie68

There's one minor cosmetic issue left: when the text wraps, there should be a space appended at the end of each wrapping line. At least that's the style all other pop-up windows have. I'm not sure if that is possible here though.

In the example screenshot, one space would be inserted after "Opt" and "flus" each to have the right pop-up border width match the left one.

ycm-wrap-space

hippie68 avatar Oct 19 '24 19:10 hippie68

Never mind, I just noticed that this is normal wrapping behavior even for docstrings. Which brings me to the question if there is anything else left that is stopping this pull request from being merged. I have been trying this feature for quite some time now and I would love to see it included in YCM by default.

hippie68 avatar Oct 19 '24 19:10 hippie68

Thanks for sending a PR!

mergify[bot] avatar Dec 16 '24 22:12 mergify[bot]