void FrostEdit::setUpDocumentHiltter(Document* doc) { TextEditor::Internal::Highlighter* hilt = new Fate::FateHighlighter(); //Qate::DefaultColors::ApplyToHighlighter(hilt); mSyntaxStyle.applyToHighlighter(hilt); auto ptr = mHiltDefManager->definition("Highlighters/frostbasic.xml"); if(!ptr.isNull()) hilt->setDefaultContext(ptr->initialContext()); else Q_ASSERT("Default highlight definition loading failed" && 0); doc->setHighlighter(hilt); }
JuliaEditorWidget::JuliaEditorWidget(QWidget *parent) : TextEditor::BaseTextEditorWidget( parent ) { setParenthesesMatchingEnabled( true ); TextEditor::Internal::Highlighter* highlighter = new TextEditor::Internal::Highlighter(); baseTextDocument()->setSyntaxHighlighter( highlighter ); const QSharedPointer<TextEditor::Internal::HighlightDefinition> &definition = TextEditor::Internal::Manager::instance()->definition(":/juliaeditor/julia.xml"); if (!definition.isNull() && definition->isValid()) { highlighter->setDefaultContext(definition->initialContext()); //m_commentDefinition.setAfterWhiteSpaces(definition->isCommentAfterWhiteSpaces()); //m_commentDefinition.setSingleLine(definition->singleLineComment()); //m_commentDefinition.setMultiLineStart(definition->multiLineCommentStart()); //m_commentDefinition.setMultiLineEnd(definition->multiLineCommentEnd()); setCodeFoldingSupported(true); } }