Discussion:
Force Indentation of multiple lines to cause only one TextChanged Event?
Charly Dante
2014-01-20 09:54:03 UTC
Permalink
Hi there,

I have a question: At the moment use the Scintilla Event SCN_MODIFIED to
apply some extra stuff to the code when typing. This extra logic is
computational relatively expensive. Not so expensive that it is a problem
during normal typing, but I realized that it is a problem when using TAB or
Shift-TAB to move the indentation level of the current line.

This is because if I select many lines (like 100 lines for example) and
then hit TAB, the SCN_MODIFIED Event gets fired 100 times, which results in
a noticeable lag.

Therefore my question is: Is there some possibility to only fire this event
at the end of concatenated edit-actions? So that it only gets fired after
changing the indentation of the last line?

Best Regards,
CD
--
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-interest+***@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/groups/opt_out.
Neil Hodgson
2014-01-20 21:40:20 UTC
Permalink
I have a question: At the moment use the Scintilla Event SCN_MODIFIED to apply some extra stuff to the code when typing. This extra logic is computational relatively expensive. Not so expensive that it is a problem during normal typing, but I realized that it is a problem when using TAB or Shift-TAB to move the indentation level of the current line.
This is because if I select many lines (like 100 lines for example) and then hit TAB, the SCN_MODIFIED Event gets fired 100 times, which results in a noticeable lag.
Therefore my question is: Is there some possibility to only fire this event at the end of concatenated edit-actions?
There is no support for this. You should not be performing your logic synchronously in a SCN_MODIFIED handler but should queue yourself an event and process the event(s) in idle time.

Neil
--
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-interest+***@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/groups/opt_out.
Loading...