Comments (8)
I really wish we could set labels so not everything is posted as an issue.
from scintillanet.
IDK if its implemented in ScintillaNET or not but in native scintilla, I think you will use this: SCI_GETFOLDEXPANDED
from scintillanet.
The SCI_GETFOLDEXPANDED
constants translates to the Line.Expanded
property in ScintillaNET. That will tell you whether the line is marked as expanded or collapsed, however, to determine if a line is a fold point you should test for the FoldLevelFlags.Header
flag. i.e.
if((scintilla.Lines[0].FoldLevelFlags & FoldLevelFlags.Header) > 0)
{
// ...
}
from scintillanet.
Sorry, but the code isn't working for me.
from scintillanet.
Can you be more specific? It's difficult for me to provide assistance with such little information to go on....
When I run the following code, the output matches 1 for 1 with my fold points:
foreach (var line in scintilla.Lines)
{
var message = "Lines[{0}] - fold level: {1}, is fold point: {2}";
Debug.WriteLine(message, line.Index, line.FoldLevel, ((line.FoldLevelFlags & FoldLevelFlags.Header) > 0));
}
from scintillanet.
Okay sorry about that. You example fixed my issue, however I am having trouble folding/expanding a line.
Here is what I have:
public object LineIsFoldPoint(bool linenum)
{
return ((Scintilla1.Lines(linenum).FoldLevelFlags & FoldLevelFlags.Header) > 0);
}
public void FoldAll()
{
foreach (Line ln in Scintilla1.Lines) {
if (LineIsFoldPoint(ln.Index)) {
ln.FoldLine(FoldAction.Contract);
}
}
}
The FoldAll() method does nothing for me, the same if I try FoldAction.Toggle or FoldAction.Expand
from scintillanet.
Scintilla.FoldAll(FoldAction.Toggle)
does exactly as advertised for me....
Are you implementing custom folding or using one provided by a lexer? If you are implementing your own, the chances are your error is in your implementation. Custom folding can be difficult. Studying the Scintilla lexer source code can be helpful here as can be helper methods which dump your current FoldLevel
and FoldLevelFlags
as the sample I have above does.
from scintillanet.
WHAT, how did I not see this?! Thank you!
from scintillanet.
Related Issues (20)
- Changing EOL type crashes Scintilla HOT 4
- Help!!! How to setting color of default text HOT 2
- Avalonia UI support HOT 1
- Help! Cannot find a mask that works for RgbaImage marker symvol HOT 1
- How do i remove this corner? HOT 1
- How does line indentation work? HOT 1
- Question Regarding Combined Characters and Regex
- Failed to create component 'Scintilla' HOT 4
- sign project
- How can I remove the background color of the focused line? HOT 2
- Is there any way to highlight BETWEEN characters?
- Scrollbar don't work
- Scintilla Control causes caret in other controls to jump/bug HOT 1
- STOP drag drop on windows
- Lexer.Html does not support code folding
- Error on HEREDOC php HOT 3
- Cant drag ScintillaNET control into the form.
- Undo and Redo HOT 1
- .Lines[intIndex].Position always returns 0. - Latest version, not 3.6 release.
- Find in files feature
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scintillanet.