MCPcopy Create free account
hub / github.com/SpartanJ/eepp / resetSyntax

Method resetSyntax

src/eepp/ui/doc/textdocument.cpp:729–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

727}
728
729void TextDocument::resetSyntax() {
730 String header( getText(
731 { { 0, 0 },
732 positionOffset( { 0, 0 },
733 FileSystem::fileExtension( mFilePath ) == "h" ? 5 * 1024 : 128 ) } ) );
734 auto oldDef = mSyntaxDefinition ? mSyntaxDefinition->getLanguageIndex() : 0;
735 {
736 Lock l( mSyntaxDefinitionMutex );
737 mSyntaxDefinition = SyntaxDefinitionManager::instance()->findPtr(
738 mFilePath, header.toUtf8(), mHExtLanguageType );
739 }
740 if ( mSyntaxDefinition->getLanguageIndex() != oldDef )
741 notifySyntaxDefinitionChange();
742}
743
744bool TextDocument::getAutoDetectIndentType() const {
745 return mAutoDetectIndentType;

Callers 1

resetSyntaxDefinitionMethod · 0.80

Calls 3

getLanguageIndexMethod · 0.80
findPtrMethod · 0.80
toUtf8Method · 0.80

Tested by

no test coverage detected