Skip to content
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

Multiline C++ comments fail to highlight correctly #486

Closed
akshaykhadse opened this issue Apr 1, 2022 · 1 comment · Fixed by #624
Closed

Multiline C++ comments fail to highlight correctly #486

akshaykhadse opened this issue Apr 1, 2022 · 1 comment · Fixed by #624
Assignees
Labels
bug Something isn't working released Available in a released installer

Comments

@akshaykhadse
Copy link

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 akshaykhadse added bug Something isn't working unread I have seen it or had time to refine it yet labels Apr 1, 2022
@stevencohn stevencohn removed the unread I have seen it or had time to refine it yet label Apr 4, 2022
@stevencohn
Copy link
Owner

#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 stevencohn self-assigned this Sep 22, 2022
@stevencohn stevencohn linked a pull request Sep 22, 2022 that will close this issue
@stevencohn stevencohn added next-release Addressed but not yet released released Available in a released installer and removed next-release Addressed but not yet released labels Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released Available in a released installer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants