On 11 August 2015 at 14:51, BillWoo <
therealu...@gmail.com> wrote:
> Hi, This is my first post about Scintilla, and I'd like to start by thanking
> the authors, and this community, for a remarkable resource !
>
> I've searched to see if anyone has implemented auto-indent-by-tabs, and the
> only thing I found was a reference to Scintilla as used in "Zeus" something
> or other; I couldn't locate any usable code, or relevant discussions.
>
> If you know of existing code to implement auto-indent, I'd appreciate a
> link.
>
> My initial experiments in implementing auto-indent:
>
> 1. verified that executing that run-time execution of the code:
>
> private char tab = '\t';
>
> private void button1_Click(object sender, EventArgs e)
> {
> scintilla1.InsertText(-1, Tab);
The documentation on INSERTCHECK says "Text is about to be inserted.
The handler may change the text being inserted by calling
SCI_CHANGEINSERTION. No other modifications may be made in this
handler." so you can't run this in the insert check.
> }
>
> in a Button Click EventHandler works as expected.
>
> 2. then I implemented a simple facility to keep track of the number of tabs
> on the previous line, and tried to use the Scintilla 'InsertCheck method to
> modify the text when a new line was entered so the correct number of tabs
> was prefixed to the new line:
>
> a. I observe an unusual behavior:
>
>
> 1. the first line entered would be prefixed with the correct number of tab
> characters, but the second, and each alternating line would be prefixed with
> twenty-one tab characters.
>
>
> 2. that, of course, suggests some form of recursion, but stepping through
> the code, there's no evidence of recursion.
>
>
> On request, I'll post the full code, but, perhaps, there is already a simple
> explanation for what I observe.
>
> thanks, Bill
>
> --
> You received this message because you are subscribed to the Google Groups
> "scintilla-interest" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
scintilla-inter...@googlegroups.com.
> To post to this group, send email to
scintilla...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/scintilla-interest.
> For more options, visit
https://groups.google.com/d/optout.