| 275 | } |
| 276 | |
| 277 | void 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 | |
| 296 | void TextEditorPrivate::initLanguageClient() |
| 297 | { |
no test coverage detected