<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
I believe the community's interest in this feature can be
demonstrated with three simple arguments:<br>
<br>
1. The amount of code needed to implement what you described is
comparable to the size of the existing CodeArea itself.<br>
2. This feature already exists in RichTextFX (JavaFX) and
RSyntaxTextArea (Swing).<br>
3. It’s also present in editors like NetBeans, IntelliJ IDEA, and VS
Code.<br>
<br>
So, I think there’s every reason to add it to JFX CodeArea as well.<br>
<br>
Best regards, Pavel<br>
<br>
<div class="moz-cite-prefix">On 4/29/25 22:24, Andy Goryachev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:BYAPR10MB301380129831C5C9CE0A3EE1E5802@BYAPR10MB3013.namprd10.prod.outlook.com">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">Code
folding is not currently supported by the CodeArea, at least
with the models provided.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">It
might be possible to implement the folding in a custom
component, using the following steps:<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">-
implement a custom line number component which shows the
folding decorations, knows how to get the actual line numbers,
and how to handle the fold/unfold events<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">-
implement a model that knows how to fold, and exposes the
folding APIs<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">-
modify the behavior of the CodeArea to deal with the folding
as required: copy/paste, navigation, etc.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">I
suppose it's possible to
<i>fold</i> these features into the stock CodeArea, given
sufficient interest from the community.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
</blockquote>
<br>
</body>
</html>