SCN_MODIFIED notification with source?

85 views
Skip to first unread message

Wonson

unread,
Sep 15, 2016, 1:26:15 AM9/15/16
to scintilla-interest
Is it possible to determine the modified source? like when some text inserted, can u tell it's from SETTEXT or directly user keydown or autocomplete insert?
If it can tell such information, that would be useful, thx.

Neil Hodgson

unread,
Sep 16, 2016, 6:20:20 AM9/16/16
to scintilla...@googlegroups.com
Wonson:

> Is it possible to determine the modified source? like when some text inserted, can u tell it's from SETTEXT or directly user keydown or autocomplete insert?

Not in general. There is an SCN_AUTOCCOMPLETED after autocompletion. I did consider an ‘operation’ parameter for SC_MOD_INSERTCHECK but couldn’t think of a good use case and it could require a lot of code modifications to tag each change.

http://www.scintilla.org/ScintillaDoc.html#SCN_AUTOCCOMPLETED

Neil

Wonson

unread,
Sep 18, 2016, 10:35:06 PM9/18/16
to scintilla-interest, nyama...@me.com
What would be your SC_MOD_INSERTCHECK intented to do?

Neil Hodgson於 2016年9月16日星期五 UTC+8下午6時20分20秒寫道:

Neil Hodgson

unread,
Sep 19, 2016, 12:15:54 AM9/19/16
to scintilla...@googlegroups.com
Wonson:

> What would be your SC_MOD_INSERTCHECK intented to do?

https://groups.google.com/d/msg/scintilla-interest/eVi6bobA2tw/Tdq2UJfuqrYJ

Neil

Wonson

unread,
Oct 13, 2016, 3:11:33 AM10/13/16
to scintilla-interest, nyama...@me.com
Neil,

Hmm...Maybe I ask this way: How do you define "SC_PERFORMED_USER"? 
I get this flag from notification, though I was calling SCI_REPLACESEL etc.

I expect any programatically method call would not turn on this flag, it should only be turned on when "user typing".
However, currently it seems that any insert outside scintilla backend is SC_PERFORMED_USER?

At least I need a flag which is able to determine "whether it is modified by a human directly input in the editor". Something like that.

Wonson

Neil Hodgson於 2016年9月19日星期一 UTC+8下午12時15分54秒寫道:

Neil Hodgson

unread,
Oct 13, 2016, 6:06:11 PM10/13/16
to Scintilla mailing list
Wonson:

> Hmm...Maybe I ask this way: How do you define "SC_PERFORMED_USER”?

Not SC_PERFORMED_UNDO or SC_PERFORMED_REDO.

> ot I get this flag from notification, though I was calling SCI_REPLACESEL etc.

Scintilla can’t tell the difference between a SCI_CUT performed by the user pressing a key and an application performing some operation through SCI_CUT.

> At least I need a flag which is able to determine "whether it is modified by a human directly input in the editor". Something like that.

Input source is not currently tracked in Scintilla. If you want to differentiate calls that your application performs then maintain a flag that is set before each call to Scintilla and reset after the call.

Neil
Reply all
Reply to author
Forward
0 new messages