-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add guifont cmdline completion (for Windows and GTK) #13264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
For Windows, auto-complete will only suggest monospace fonts as that's
the only types allowed. Will also suggest font options after the colon,
including suggesting the current font size for convenience, and misc
charset and quality options like `cANSI` and `qCLEARTYPE`.
For GTK, auto-complete will suggest only monospace fonts for `guifont`
but will include all fonts for `guifontwide`. The completion code
doesn't currently suggest the current font size, as the GTK guifont
format does not have a clear delimiter (':' for other platforms).
Codecov Report
@@ Coverage Diff @@
## master #13264 +/- ##
==========================================
+ Coverage 78.33% 82.15% +3.82%
==========================================
Files 150 160 +10
Lines 153287 196256 +42969
Branches 39519 43974 +4455
==========================================
+ Hits 120076 161234 +41158
- Misses 20932 22137 +1205
- Partials 12279 12885 +606
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Code coverage is complaining a lot of lines aren't testing. Most of them are due to guards around not being able to allocate memory. I'm following the pattern that I see in other areas in Vim's codebase and making sure to check against allocation results, but I don't know if there are good ways to test such situations. |
You can use the test_alloc_fail() function to test for allocation failures. To use this function, |
Hmm that seems like a lot of work though. As in, the pattern that I see (and therefore follow) usually call |
Bram initially added the basic infrastructure (in 7.4.1058 and 7.4.1073) for testing memory Relevant patches: |
|
Right. That's useful context to know. It feels to me this is quite manual and difficult to roll out across the board as it requires exhaustively tagging all your allocation, and testing each feature against it. FWIW I think sometimes test coverage % could be a fickle thing. I'm working on another PR to fix cmdline expansion code related to escaping commas and spaces, and there are some tests that while technically "cover" the lines in question by getting the code to visit that code path (therefore increasing the code coverage %), do not actually test that the underlying behavior (it will be fixed in my PR) works. |
|
As an aside, if you look at the change, in GTK Linux, if you don't have a |
|
thanks! |
Problem: no cmdline completion for setting the font
Solution: enable it on Win32 and GTK builds
Add guifont cmdline completion (for Windows and GTK)
For Windows, auto-complete will only suggest monospace fonts as that's
the only types allowed. Will also suggest font options after the colon,
including suggesting the current font size for convenience, and misc
charset and quality options like `cANSI` and `qCLEARTYPE`.
For GTK, auto-complete will suggest only monospace fonts for `guifont`
but will include all fonts for `guifontwide`. The completion code
doesn't currently suggest the current font size, as the GTK guifont
format does not have a clear delimiter (':' for other platforms).
closes: vim#13264
Signed-off-by: Christian Brabandt <[email protected]>
Co-authored-by: Yee Cheng Chin <[email protected]>


For Windows, auto-complete will only suggest monospace fonts as that's the only types allowed. Will also suggest font options after the colon, including suggesting the current font size for convenience, and misc charset and quality options like
cANSIandqCLEARTYPE.For GTK, auto-complete will suggest only monospace fonts for
guifontbut will include all fonts forguifontwide. The completion code doesn't currently suggest the current font size, as the GTK guifont format does not have a clear delimiter (':' for other platforms).