Allow soft-wrapping of lines in the signature help window
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.
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
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.
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.
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.
I think I got this working. @hippie68 would you mind trying this branch/patch?
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.
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.
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.
Thanks for sending a PR!