OneMore
OneMore copied to clipboard
Multiline C++ comments fail to highlight correctly
Issue Multiline C++ comments fail to color correctly because of keywords 'and' and 'this'. Text post these words is black instead of green. Not sure if there are more. See the following
To Reproduce
- Write C++ code that has more than 5 lines of multiline comment. Make sure that your comment uses the word 'and'.
- Click on OneMore > Edit > Colorize > C++
- See that the text after first 'and' is not colored.
- This behavior happens for all 'and' and 'this' words in the comment text. Perhaps some issue with the lexer.
Expected behavior All comment text should be green. See below:
Environment (if applicable):
- OneNote Version: Office 365 64bit
- OneMore Version: 4.17
#487 asked: how does colorizing work in OneMore?
Each language is defined by is its own file here. C++ multiline comments are defined here.
These files are used by the Parser class implemented in Colorizer/Parser.cs. The current scope (state) is maintained using the language.Scopes array and the scopeOverride local variable. These are passed back to the caller's report Action which maps to a color by the language Theme. The scopeOverride should track scopes across multiple lines. Apparently, this is where the bug exists...