Discussion:
Syntax Highlighting of New Documents
Gary Beene
2014-01-08 16:11:37 UTC
Permalink
When I create a new document and attach it to a Scintilla control, any
previously assigned syntax highlighting settings apply to the new document.
At least, that what my testing shows.

But in a larger multi-tab'd app (single Scintilla control displaying
multiple documents), I cannot get highlighting to show in the original
Scintilla control document, much less to a newly attached document.

Confusingly, in the same app I can apply highlighting to a second Scintilla
control, one which does not make use of the Sci_CreateDocument techiques,
and the highlighting shows just fine.

Are there any general troubleshooting suggestions that help me pin down why
this might be occurring? The same initialization function (argument is the
Scintilla handle) is applied to both Scintilla controls. It takes effect
in one, but not the other.
--
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.
Gary Beene
2014-01-08 21:02:53 UTC
Permalink
A picture may help.

Lower left - Scintilla displays syntax highlighting just fine (no
CreateDocument code involved)

Upper right - Scintilla (one control, several documents) does not display
the highlighting (does display guides, however).
--
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-08 22:14:24 UTC
Permalink
If you are using a recent (>= 2.0) version of Scintilla, then the lexer is attached to the document and the visual styles are attached to the view. You should set the correct lexer when a document is first displayed in a view.

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.
Gary Beene
2014-01-09 03:53:11 UTC
Permalink
*Neil,*
Thank you very much. That was the guidance I needed! I'm now getting
syntax highlighting in both Scintilla controls and in all views.
--
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...