-
Notifications
You must be signed in to change notification settings - Fork 240
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
Cpp standard library #86
Conversation
value_if_global_boolean_else_other to enable bold to be optionally toggled
and built-in functions through PaperColor_C_Highlight_Builtins
Additionally, this specifically targets the following plugin due to its active development and up-to-date status: |
Great work again! 🥇 I'm thinking a different way of providing config options. We obviously don't want a separate function for each option. Below is what I'm aiming at, extending the global variable
let g:PaperColor_Theme_Options = {
\ 'language': {
\ 'python': {
\ 'highlight_builtins' : 1
\ },
\ 'cpp': {
\ 'highlight_standard_library': 1
\ }
\ }
\ }
Using that in if s:LanguageOptions('cpp.highlight_standard_library', 1)
call s:HL("cppSTLtype", s:pink, "", s:bold)
else
call s:HL("cppSTLtype", s:foreground, "", "")
endif This way, I think, is shorter and easier to maintain in the future. I'll provide the function |
I've added that in 39a7084 The function is let g:PaperColor_Theme_Options = {
\ 'language': {
\ 'python': {
\ 'highlight_builtins' : 1
\ }
\ } There can be any number of languages alongside with Python in this case, and each can have multiple options. The way to check if the option is set to 1 is very simple in I refactored the Python builtins feature in the commit, please see that as example, and it would be great if you can help refactor the current C/CPP options to this new way. 😃 |
C builtins / C++ standard library syntax options
This pull request resembles:
#84
However, I've put some thought into highlighting options for the C++ standard library / C language builtins. I believe this option is especially important for C++ because the standard library is 2/3 of the written standard. As usual, this pull request provides users the option to override the default behavior of no builtin highlighting, keeping with PaperColor's philosophy.
Change to global boolean evaluation function
In order to elegantly implement the syntax options for the standard library functions, I needed a way to impact both the "bold" flag and the syntax color. In order to achieve this elegantly, I changed the boolean flag function to take three values:
By generalizing the abstract function (eg, can choose your own default, not mentioning color specifically to enable using signals for thickness instead of color), I was able to use the derived functions to handle both color and boldness. As a result, I had to revise the functions used for Python builtins. However, to me, this makes the framework simpler and more extensible. Hopefully you agree!