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

Code Folding and Delimiter Styles can't coexist (latest version 7.6.6 64-bit) #5604

Open
LorneCash opened this issue May 1, 2019 · 1 comment
Labels
udl Everything related to User Defined Language

Comments

@LorneCash
Copy link

This issue is a copy of a closed issue: #274 with slightly improved format. I've verified that the issue still exists and was directed to open a new ticket for the same issue.

Description of the Issue

Code Folding and Delimiter Styles can't coexist is this case.

Here are my settings:
Folder & Default
Folding in code 2 style (separators needed):
....Open: "Start"
....Close: "End" "Error"

Operators & Delimiters
Delimiter 1 style:
....Styler Button:
........Foreground: Black
........Background: White
....Open: Trace
....Close: CRLF (I pasted a CRLF but it apears blank since it's only whitespace)

Delimiter 2 style:
....Styler Button:
........Foreground: Black
........Background: Red
....Open: Error
....Close: CRLF (I pasted a CRLF but it apears blank since it's only whitespace)

Steps to Reproduce the Issue

  1. Setup user defined Language as described above
  2. Apply the user defined language to the following text:
    Trace | Main: Start
    Trace | ....New: Start
    Trace | ....New: End
    Trace | ....Method1: Start
    Trace | ........Method2: Start
    Trace | ............Method3: Start
    Trace | ................Method4: Start
    Error | ....................## System.Exception
    Error | ....................## Message: Object reference not set to an instance of an Object
    Trace | ................Method4: End
    Trace | ............Method3: End
    Trace | ........Method2: End
    Trace | ....Method1: End
    Trace | Main: End

Expected Behavior

Rows starting with the word Error are highlighted in Red (This works)
Code folding (+) markers appear on every line that ends with "Start"

Actual Behavior

Rows starting with the word Error are highlighted in Red (This works)
There are no Code folding (+) markers whatsoever
When the Delimiter Style Open value is cleared the code folding works properly but then the rows are not highlighted

Debug Information

Notepad++ v7.6.6 (64-bit)
Build time : Apr 3 2019 - 23:52:32
Path : C:\Program Files\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS : Windows 10 (64-bit)
Plugins : mimeTools.dll NppConverter.dll XMLTools.dll

@Ekopalypse
Copy link
Contributor

From what I understood with my limited knowledge of C++, styling and folding is done in one go.
With a configuration, like posted, the folding start would never be determined as the udl lexer has no nesting of "folding" defined.
A solution would be either to split styling and folding or introduce another level of nesting for folding points.
Sounds like a lot of work.
The simplest solution, although not in the interested of the OP,
would be to make clear that a delimiter must not be overlap folding points.

In this particular case so, the solution would be to define the colon as the closing delimiter unless the example isn't covering real data

@MetaChuh MetaChuh added the udl Everything related to User Defined Language label May 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
udl Everything related to User Defined Language
Projects
None yet
Development

No branches or pull requests

3 participants