> On May 19, 2025, at 3:30 PM, Jean Lalonde <
jlalo...@gmail.com> wrote:
>
> Hi Mitchell,
>
> Yes, the offsets were wrong. I got them fixed (thanks to AHK users in this thread).
>
> With this in the Scintilla creation:
>
> o_Sci.SETMODEVENTMASK(0)
> o_Sci.NOTIFY := "SciOnNotify"
>
> And this in SciOnNotify():
>
> if (obj.SCNCode == SCN_UPDATEUI
> and (obj.Updated & (SC_UPDATE_CONTENT | SC_UPDATE_SELECTION) > 0))
> {
> Diag(A_ThisFunc, aaScnCodes[obj.SCNCode] . " obj.Updated / obj.Ch", obj.Updated . " / " . obj.Ch)
> Gosub, EditorContentChanged
> }
>
> What I get in the log file is now correct for the .Updated values. But I .Ch is always empty even when .Updated contains 1 (SC_UPDATE_CONTENT):
>
> 20250519@15:19:24.889 SciOnNotify SCN_UPDATEUI obj.Updated / obj.Ch 9 / 0
> 20250519@15:19:25.727 SciOnNotify SCN_UPDATEUI obj.Updated / obj.Ch 1 / 0
> 20250519@15:19:27.338 SciOnNotify SCN_UPDATEUI obj.Updated / obj.Ch 2 / 0
> 20250519@15:19:29.731 SciOnNotify SCN_UPDATEUI obj.Updated / obj.Ch 1 / 0
> 20250519@15:19:30.048 SciOnNotify SCN_UPDATEUI obj.Updated / obj.Ch 1 / 0
> 20250519@15:19:30.388 SciOnNotify SCN_UPDATEUI obj.Updated / obj.Ch 1 / 0
> 20250519@15:19:31.298 SciOnNotify SCN_UPDATEUI obj.Updated / obj.Ch 3 / 0
>
> From what I read in the Scintilla doc, the .Ch value is only returned for these SCNCode values:
>
> int ch;
> /* SCN_CHARADDED, SCN_KEY, SCN_AUTOCCOMPLETED, SCN_AUTOCSELECTION, */
> /* SCN_USERLISTSELECTION */
>
> What should I change in the mask or if to get the .Ch info (neeeded to handle auto-indentation)?
I think you would have an `} else if (obj.SCNCode == SCN_CHARADDED && obj.Ch == 10) {` block.
The mask only applies to `SCN_MODIFIED` notifications, which any no other notification is.