This repository was archived by the owner on Jan 13, 2024. It is now read-only.
This repository was archived by the owner on Jan 13, 2024. It is now read-only.
Incorrect SetFoldLevel signature #70
Closed
Description
SetFoldLevel needs to have an integer type as its second parameter instead of the FoldLevel enum.
Activity
mahee96 commentedon May 23, 2021
@Ekopalypse , There are auto generated enums in GatewayDomain.cs file, this was intentional to have more meaning to the flag grouping.
Why don't you try using it instead, if you still face issue re-open this issue.
If you strongly feel it should be int/uint as per the official interface doc of Scintilla, then please open a new issue as question because it covers more fields than the FOLDFLAG alone and needs to be dealt separately.
Ekopalypse commentedon May 23, 2021
@mahee96
But FoldFlag enum is something else and is used by the call SCI_SETFOLDFLAGS.
SCI_SETFOLDLEVEL sets the current level per line and is used to determine which rows must be must be collapsed/expanded, while FoldFlags describe how folded/expanded rows should be visually displayed.
mahee96 commentedon May 23, 2021
Oops sorry for the confusion, I meant to refer you to FoldLevel enum in the Gatewaydomain.cs, Could you please check that enum satisfies your request
mahee96 commentedon May 23, 2021
@Ekopalypse checkout this
Ekopalypse commentedon May 23, 2021
No, these are the flags which need to be used in combination with additional integers.
Let me give you an example, assume in the following code and we want to mark the { as the open folding tag and } as the closing tag like npp does.
To set the respective flags you would set to line
0 -> BASE
1 -> BASE | HEADERFLAG
2 - 6 -> BASE + 1
7 -> BASE
Now scintilla knows where to put the folding markers and how many lines to collapse or fold.
Ekopalypse commentedon May 23, 2021
Maybe this example is more descriptive
The lines need to be set like
0x0400
0x2400
0x2401
0x2402
0x0403
0x0403
0x0402
0x0401
0x0400
mahee96 commentedon May 24, 2021
okay there is a slight discrepancy in Scintilla.iface file and the official documentation which we have to fix.
The documentation states:
whereas the Scintilla.iface file states:
I think while updating the converter, we missed some info which states the obvious for types and enumerations.
So essentially those enumerations if in C/C++ would be not typed but plain integers which could be combined using plain pipe/or operation. But in C# it needs to be of int type as the document states.
mahee96 commentedon May 24, 2021
@Ekopalypse , a quick fix can be made for this particular field for now, but the inventory of affected fields will be performed later some time and a fix will be given.
17 remaining items