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

Method loadFromFile

src/eepp/ui/tools/uidiffview.cpp:847–861  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

845}
846
847void UIDiffView::loadFromFile( const std::string& oldFilePath, const std::string& newFilePath ) {
848 std::string oldText, newText;
849 FileSystem::fileGet( oldFilePath, oldText );
850 FileSystem::fileGet( newFilePath, newText );
851
852 auto def = SyntaxDefinitionManager::instance()->getByExtension( newFilePath );
853 mSyntaxDef =
854 SyntaxDefinitionManager::instance()->getLanguageDefinition( def.getLanguageIndex() );
855 mEditor->getDocument().setSyntaxDefinition( def );
856 mLeftEditor->getDocument().setSyntaxDefinition( def );
857 mRightEditor->getDocument().setSyntaxDefinition( def );
858 mFileName = FileSystem::fileNameFromPath( newFilePath );
859
860 loadFromStrings( oldText, newText );
861}
862
863void UIDiffView::updateButtonsText() {
864 mModeToggle->setText( i18n( "diffview_side_by_side", "Side by Side" ) );

Callers 2

loadFileFromPathMethod · 0.45
loadImageAsyncMethod · 0.45

Calls 4

getLanguageDefinitionMethod · 0.80
getLanguageIndexMethod · 0.80
getDocumentMethod · 0.80
setSyntaxDefinitionMethod · 0.45

Tested by

no test coverage detected