MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / loadLexer

Method loadLexer

src/plugins/codeeditor/gui/private/texteditor_p.cpp:277–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275}
276
277void TextEditorPrivate::loadLexer()
278{
279 if (fileName.isEmpty())
280 return;
281
282 using namespace support_file;
283 auto id = Language::id(fileName);
284 QFont font(fontName, fontSize, QFont::Normal);
285 if (auto lexer = LexerManager::instance()->createSciLexer(id, fileName)) {
286 lexer->setParent(q);
287 lexer->setDefaultFont(font);
288 q->setLexer(lexer);
289 setMarginVisible(FoldingMargin, true);
290 } else {
291 q->setFont(font);
292 setMarginVisible(FoldingMargin, false);
293 }
294}
295
296void TextEditorPrivate::initLanguageClient()
297{

Callers 2

openFileMethod · 0.80
openFileWithDocumentMethod · 0.80

Calls 5

createSciLexerMethod · 0.80
setDefaultFontMethod · 0.80
setLexerMethod · 0.80
isEmptyMethod · 0.45
setFontMethod · 0.45

Tested by

no test coverage detected