How do I hide the first line in ScintillaNET?

With the ScintillaNET control I can hide line 2

scintilla.Text = "Line 1\r\nLine 2\r\nLine 3";
scintilla.HideLines(1,1);

      

or lines 2 and 3

scintilla.Text = "Line 1\r\nLine 2\r\nLine 3";
scintilla.HideLines(1,2);

      

but nothing that starts at line 1 (index 0)

scintilla.Text = "Line 1\r\nLine 2\r\nLine 3";
scintilla.HideLines(0,2);

      

How to hide the first line of text in ScintillaNET?

Line 1 of my file format is written by an editor and will never be edited by the user, so I would like it not to display at all.

+3


source to share


1 answer


I don't think this HideLines

is the right tool for the job as it is part of the Scintilla folding API . the API style would probably be more appropriate.

However, I doubt that any API by itself can actually prevent hidden text being edited by the user. For example, to handle custom code that requires additional locking, the user can delete the block of text that contains the hidden portion (this is, of course, true for folding APIs).



In your particular case, however, there is no much simpler solution? Why not just remove the first line of text before loading it into the editor (and add it back before saving)?

+3


source







All Articles