This project is read-only.

Limit Editor Width

Topics: Developer Forum, User Forum
Mar 19, 2015 at 9:11 PM
Hi guys,

Been working with this for a couple weeks now, have a nice editor with keyword highlighting and calltips working. I was looking to move into syntax error catching now. So I am trying a brute force method of looking at the entire text every time a CharAdded event happens. I separate the text by lines and check the syntax of each line.

This all ties into my discussion topic. I want to limit the column width in the editor to 72 chars. There is a continuation character in my language that allows for a line to spill over multiple lines. But as it stands now I merely have char wrap on, and a fixed scintilla width to simulate a new line every 72 characters. Is there a way that I can make Scintilla's text field have a fixed character width without wrapping?

I was thinking counting characters then when 71 gets hit slapping down a continuation character and a newline. Is there a better solution you can think of?

Mar 20, 2015 at 12:44 AM
There is no built-in way to limit the line length. You're approach to watch CharAdded (or one of the other text modification events (or the InsertCheck event in a future build of ScintillaNET)) is the best you're going to get.

Mar 23, 2015 at 3:03 PM
Thanks for the quick reply. I appreciate it. Is there a way to MarkSyntaxError from the main Form? I currently use NativeInterface.SetIndicatorCurrent(0) and give it the range when more than 72 chars are on a line. This gives a green squiggle. Also, is there support for indicators to have CallTips, or will I have to hack something together for that?