Max length in Syntax Editor

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by anrdrewvin
Avatar
I need to set maximum length of the text in syntax editor control.
Is there easy way to do that?

Comments (8)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
No there isn't a property for that yet. Good suggestion though. I'll add it to the TODO list. If a modification would cause the text to exceed its maximum length should it just be aborted?


Actipro Software Support

Posted 14 years ago by anrdrewvin
Avatar
I think it should work the same way as in standard TextEdit & RichEdit.
If text input using keyboard or pasting from clipboard exceed MaxLength property the symbols more than that are ignored.
Posted 14 years ago by NeilT
Avatar
Quote:
<font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Actipro Software Support:
No there isn't a property for that yet. Good suggestion though. I'll add it to the TODO list. If a modification would cause the text to exceed its maximum length should it just be aborted?<HR>


You could fire an event with a System.ComponentModel.CancelEventArgs that allows developers to apply what they feel is the appropriate logic. You could expand on this to provide alternatives to just truncating ie. highlight the text overflow with a span indicator etc.
Posted 14 years ago by Grut
Avatar
You probably did your own test so ...
What is really the maximum file size can we use when activate highlinting, intellisense, collapsing region ? (I assume for having a "normal" memory occupation)
For me (in debug), the application, when launched, takes 45Mo.
When opening a new MDIChild which contains a syntaxeditor, 48Mo.
Same thing but opening a file (300o), 49Mo.
Put 10000 lines, up to 65Mo. (hightlinthing, region activated)
So if I do it again, when I opened a 10000 lines file, I take 13Mo more (200ko)
Oh ! just now, I do a "select all", then I more the cursor down and 99% proc,
my application stop ...
Yeah, think I found a bug: Create a file with 10000 lines and all options activated,
do a "select all" a then a "copy". Here, my application freeze.

So, It's already to long <IMG SRC="smile.gif" border="0">, my question is, will syntaxeditor will be improved on order to manage better big files ? It's not possible to open a more then 2Mo file I think ? Maybe it's a problem with my configuration ... can others said me what is the memory behaviour for them ?
Thanks and sorry for this too long post !
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Since each token has to store parse data, the larger your document, the larger the impact on memory. The maximum really depends on the client machine. We've done a lot of work with memory recent and was able to resolve some issues that were retaining references.

We do have an item on the TODO list to try and develop some sort of "lite" mode that allows for large files without a big of a memory impact.


Actipro Software Support

Posted 14 years ago by Grut
Avatar
Great ! That's a really good news <IMG SRC="smile.gif" border="0">
Posted 14 years ago by Grut
Avatar
Add what about my bug ? <IMG SRC="smile.gif" border="0">
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ah sorry, I missed that part. <IMG SRC="smile.gif" border="0"> As for that bug I believe it was a problem that we fixed in a recent release. We had added a feature that copies RTF formatted text to the clipboard so you can paste syntax-highlighted code into applications like Word. Our old method of doing so was a little time consuming and I believe you are problem running a version that used that method. In a recent release we rewrote it so that the RTF conversion occurs almost instantly. I just tried copying a 15000+ line document and it went quickly with the latest release.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.