Exlude MQL4 colors from formating (e.g. C'250,250,250')
Exlude MQL4 colors from formating (e.g. C'250,250,250')
Loading saved threads...
Hermann · External communityPost link
External question — Stack Overflow Stack Exchange
Author: Hermann
Original post: https://stackoverflow.com/questions/63056642
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
I'm using visual studio code for MQL4 files (*.mq4 - Metatrader) and using cpp associations in my settings
"files.associations": {
"*.mqh": "cpp",
"*.mq4": "cpp",
"*.mq5": "cpp",
}
I also switched to the Google formatter with the following setting
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 0}"
Everything is perfect but in mq4 you can use predefined colors like clrBlack, clrWhite, .... or use any RGB value in the format
C'250,250,250'
When I use such a RGB color and format the file the formatter adds a space after the C - so C'250,250,250' gets
C '250,250,250' <-- see the space after "C"
and this doesn't compile anymore.
How can I "whitelist" this for the cpp formatter?
Thanks
Quote
Report
Steven Nkeneng · External communityPost link
External answer — Stack Overflow Stack Exchange
Author: Steven Nkeneng
Original post: https://stackoverflow.com/a/74458150
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
I solved this by using the method:
StringToColor("33,44,33")
Quote
Report
Post Reply
Checking account access…