OneMore icon indicating copy to clipboard operation
OneMore copied to clipboard

Multiline C++ comments fail to highlight correctly

Open akshaykhadse opened this issue 2 years ago • 1 comments

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 onemore

To Reproduce

  1. Write C++ code that has more than 5 lines of multiline comment. Make sure that your comment uses the word 'and'.
  2. Click on OneMore > Edit > Colorize > C++
  3. See that the text after first 'and' is not colored.
  4. 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: pygments

Environment (if applicable):

  • OneNote Version: Office 365 64bit
  • OneMore Version: 4.17

akshaykhadse avatar Apr 01 '22 04:04 akshaykhadse

#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...

stevencohn avatar Apr 10 '22 11:04 stevencohn