Пример #1
0
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);
}
Пример #2
0
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);
  }
}
Пример #3
0
void FrostEdit::applySettings() {
	loadStyleSheet(Settings::get("Appearance/StyleSheet", "").toString());
	//mSyntaxStyle.load(Settings::get("Appearance/Colorscheme").toString());
	//mSettingsMenu->setSyntaxStyle(&mSyntaxStyle);
	mFont.setFamily(Settings::get("TextEditor/Font", "Lucida Console").toString());
	mFont.setPointSize(Settings::get("TextEditor/FontSize", 10).toInt());

	for(TabWidgetFrame* tabf: mTabWidgetFrames) {
		TabWidget* wid =tabf->tabWidget();
		for(int i = 0; i < wid->count(); i++) {
			TextEdit* e = toTextEdit(wid->widget(i));
			e->setFont(mFont);
			mSyntaxStyle.applyToTextEdit(e);
		}
	}


	for(auto i: mOpenDocuments.keys()) {
		Document* doc = mOpenDocuments[i];
		TextEditor::Internal::Highlighter* hilt = doc->getHighlighter();

		if(hilt != nullptr) {
			qDebug() << "Found a highlighter!";
			mSyntaxStyle.applyToHighlighter(hilt);
			hilt->rehighlight();
		}
	}

	for(int i = 0; i < mApplicationOutput->count(); i++) {
		Console* c = toConsole(mApplicationOutput->widget(i));
		mSyntaxStyle.applyToConsole(c);
	}

	mSyntaxStyle.applyToConsole(mCompileOutput);
	mSyntaxStyle.applyToIssueList(mIssueList);

}