Optimize Notification processing

Jean Lalonde <[email protected]> Sun, 18 May 2025 12:40:12 -0700 (PDT)
Newsgroups gmane.comp.lib.scintilla.devel
Message-ID <[email protected]>
Hi,

I'd like to check with you if I have the optimal setting to minimize the 
number of notifications but get all those I need to update the status bar 
with the length of text in the editor, length of selected text, position of 
the caret (line, column), etc. and to process line auto-indentation (as 
explained in Scintilla Usage Notes).

I'm setting this event mask:

o_Sci.SETMODEVENTMASK(SCN_MODIFIED) ; eventMask can be SCN_MODIFIED or 
SC_MOD_INSERTTEXT|SC_MOD_DELETETEXT

I'm setting the notification handler with this:

o_Sci.NOTIFY := "SciOnNotify"

And inside SciOnNotify(), I first update the status bar:

if (obj.SCNCode == SCN_CHARADDED and obj.Modifiers = 10) ; 
SCN_CHARADDED:=2001, 10 for LF
{
Gosub, AutoIndent
}

... and update the status bar:

if (obj.SCNCode = SCN_MODIFIED) ; SCN_MODIFIED:=2008
and (obj.ModType != 20) ; SC_MOD_CHANGESTYLE := 0x4 | SC_PERFORMED_USER := 
0x10 = 0x14 = 20
{
Gosub, UpdateStatusbar
}

This works for what I need. But can it be optimized?

Thanks you for your input.

-- 
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 [email protected].
To view this discussion visit https://groups.google.com/d/msgid/scintilla-interest/ea0c2cfa-4f75-450a-bf53-6ca85121e586n%40googlegroups.com.