diff --git a/src/eepp/graphics/fonttruetype.cpp b/src/eepp/graphics/fonttruetype.cpp index a53e0ccaa..d61e7bcfd 100644 --- a/src/eepp/graphics/fonttruetype.cpp +++ b/src/eepp/graphics/fonttruetype.cpp @@ -514,7 +514,7 @@ Glyph FontTrueType::loadGlyph( Uint32 codePoint, unsigned int characterSize, boo FT_Error err = 0; // Load the glyph corresponding to the code point - FT_Int32 flags = FT_LOAD_TARGET_NORMAL; // | FT_LOAD_FORCE_AUTOHINT + FT_Int32 flags = FT_LOAD_TARGET_NORMAL | FT_LOAD_FORCE_AUTOHINT; if ( outlineThickness != 0 ) flags |= FT_LOAD_NO_BITMAP; if ( ( err = FT_Load_Char( face, codePoint, flags ) ) != 0 ) { diff --git a/src/eepp/ui/doc/syntaxdefinitionmanager.cpp b/src/eepp/ui/doc/syntaxdefinitionmanager.cpp index 872408deb..84912c3b2 100644 --- a/src/eepp/ui/doc/syntaxdefinitionmanager.cpp +++ b/src/eepp/ui/doc/syntaxdefinitionmanager.cpp @@ -2073,6 +2073,70 @@ SyntaxDefinitionManager::SyntaxDefinitionManager() { { "is", "keyword" }, { "new", "keyword" }, { "delete", "keyword" }, { "emit", "keyword" }, { "struct", "keyword" }, { "protected", "keyword" } } } ); + + // Objective-C + add( { "Objective-C", + { "%.m$" }, + { { { "//.-\n" }, "comment" }, + { { "/%*", "%*/" }, "comment" }, + { { "#", "[^\\]\n" }, "comment" }, + { { "\"", "\"", "\\" }, "string" }, + { { "'", "'", "\\" }, "string" }, + { { "-?0x%x+" }, "number" }, + { { "-?%d+[%d%.eE]*f?" }, "number" }, + { { "-?%.?%d+f?" }, "number" }, + { { "[%+%-=/%*%^%%<>!~|&]" }, "operator" }, + { { "[%a_][%w_]*%f[(]" }, "function" }, + { { "@[%a_][%w_]*" }, "keyword2" }, + { { "[%a_][%w_]*" }, "symbol" } }, + { { "if", "keyword" }, { "then", "keyword" }, { "else", "keyword" }, + { "elseif", "keyword" }, { "do", "keyword" }, { "while", "keyword" }, + { "for", "keyword" }, { "break", "keyword" }, { "continue", "keyword" }, + { "return", "keyword" }, { "goto", "keyword" }, { "struct", "keyword" }, + { "union", "keyword" }, { "typedef", "keyword" }, { "enum", "keyword" }, + { "extern", "keyword" }, { "static", "keyword" }, { "volatile", "keyword" }, + { "const", "keyword" }, { "inline", "keyword" }, { "switch", "keyword" }, + { "case", "keyword" }, { "default", "keyword" }, { "auto", "keyword" }, + { "const", "keyword" }, { "void", "keyword" }, { "int", "keyword2" }, + { "short", "keyword2" }, { "long", "keyword2" }, { "float", "keyword2" }, + { "double", "keyword2" }, { "char", "keyword2" }, { "unsigned", "keyword2" }, + { "bool", "keyword2" }, { "true", "literal" }, { "false", "literal" }, + { "NULL", "literal" }, { "nil", "literal" } }, + "//" } ); + + // Dart + add( { "Dart", + { "%.dart$" }, + { + { { "//.-\n" }, "comment" }, + { { "///.-\n" }, "comment" }, + { { "/%*", "%*/" }, "comment" }, + { { "\"", "\"", "\\" }, "string" }, + { { "'", "'", "\\" }, "string" }, + { { "-?0x%x+" }, "number" }, + { { "-?%d+[%d%.eE]*f?" }, "number" }, + { { "-?%.?%d+f?" }, "number" }, + { { "[%+%-=/%*%^%%<>!~|&]" }, "operator" }, + { { "%?%?" }, "operator" }, + { { "%?%." }, "operator" }, + { { "[%$%@]?\"", "\"", "\\" }, "string" }, + { { "'\\x%x?%x?%x?%x'" }, "string" }, + { { "[%a_][%w_]*%f[(]" }, "function" }, + { { "[%a_][%w_]*" }, "symbol" }, + }, + { { "await", "keyword" }, { "bool", "keyword2" }, { "break", "keyword" }, + { "case", "keyword" }, { "class", "keyword" }, { "const", "keyword" }, + { "continue", "keyword" }, { "default", "keyword" }, { "do", "keyword" }, + { "double", "keyword2" }, { "dynamic", "keyword2" }, { "else", "keyword" }, + { "enum", "keyword" }, { "false", "literal" }, { "final", "keyword" }, + { "finally", "keyword" }, { "for", "keyword" }, { "Function", "keyword2" }, + { "if", "keyword" }, { "in", "keyword" }, { "int", "keyword2" }, + { "List", "keyword2" }, { "Map", "keyword2" }, { "new", "keyword" }, + { "null", "literal" }, { "part of", "keyword" }, { "print", "keyword" }, + { "return", "keyword" }, { "static", "keyword" }, { "String", "keyword2" }, + { "switch", "keyword" }, { "then", "keyword" }, { "this", "keyword2" }, + { "true", "literal" }, { "void", "keyword" }, { "while", "keyword" } }, + "//" } ); } SyntaxDefinition& SyntaxDefinitionManager::add( SyntaxDefinition&& syntaxStyle ) { diff --git a/src/tools/codeeditor/codeeditor.cpp b/src/tools/codeeditor/codeeditor.cpp index 1a1237f81..f4b41da23 100644 --- a/src/tools/codeeditor/codeeditor.cpp +++ b/src/tools/codeeditor/codeeditor.cpp @@ -112,7 +112,11 @@ void App::updateEditorTitle( UICodeEditor* editor ) { } void App::setAppTitle( const std::string& title ) { - mWindow->setTitle( mWindowTitle + String( title.empty() ? "" : " - " + title ) ); + mWindow->setTitle( mWindowTitle + + String( mCurrentProject.empty() + ? "" + : " - " + FileSystem::fileNameFromPath( mCurrentProject ) ) + + String( title.empty() ? "" : " - " + title ) ); } void App::onDocumentModified( UICodeEditor* editor, TextDocument& ) { diff --git a/src/tools/codeeditor/projectsearch.cpp b/src/tools/codeeditor/projectsearch.cpp index 45dff9d93..3b742ee8f 100644 --- a/src/tools/codeeditor/projectsearch.cpp +++ b/src/tools/codeeditor/projectsearch.cpp @@ -62,7 +62,7 @@ searchInFileHorspool( const std::string& file, const std::string& text, const bo String str( textLine( fileTextOriginal, searchRes, relCol ) ); res.push_back( { str, { { (Int64)totNl, (Int64)relCol }, - { (Int64)totNl, ( Int64 )( relCol + text.size() ) } } } ); + { (Int64)totNl, (Int64)( relCol + text.size() ) } } } ); lSearchRes = searchRes; searchRes += text.size(); } @@ -81,7 +81,7 @@ searchInFileHorspool( const std::string& file, const std::string& text, const bo String str( textLine( fileText, searchRes, relCol ) ); res.push_back( { str, { { (Int64)totNl, (Int64)relCol }, - { (Int64)totNl, ( Int64 )( relCol + text.size() ) } } } ); + { (Int64)totNl, (Int64)( relCol + text.size() ) } } } ); lSearchRes = searchRes; searchRes += text.size(); } @@ -117,7 +117,7 @@ searchInFileLuaPattern( const std::string& file, const std::string& text, const int len = end - start; res.push_back( { str, { { (Int64)totNl, (Int64)relCol }, - { (Int64)totNl, ( Int64 )( relCol + len ) } } } ); + { (Int64)totNl, (Int64)( relCol + len ) } } } ); searchRes = end; } } while ( matched ); @@ -136,7 +136,7 @@ searchInFileLuaPattern( const std::string& file, const std::string& text, const int len = end - start; res.push_back( { str, { { (Int64)totNl, (Int64)relCol }, - { (Int64)totNl, ( Int64 )( relCol + len ) } } } ); + { (Int64)totNl, (Int64)( relCol + len ) } } } ); searchRes = end; } } while ( matched ); @@ -149,7 +149,9 @@ void ProjectSearch::find( const std::vector files, const std::strin const TextDocument::FindReplaceType& type ) { Result res; const auto occ = - String::BMH::createOccTable( (const unsigned char*)string.c_str(), string.size() ); + type == TextDocument::FindReplaceType::Normal + ? String::BMH::createOccTable( (const unsigned char*)string.c_str(), string.size() ) + : std::vector(); for ( auto& file : files ) { auto fileRes = type == TextDocument::FindReplaceType::Normal ? searchInFileHorspool( file, string, caseSensitive, wholeWord, occ ) @@ -177,7 +179,9 @@ void ProjectSearch::find( const std::vector files, std::string stri if ( !caseSensitive ) String::toLowerInPlace( string ); const auto occ = - String::BMH::createOccTable( (const unsigned char*)string.c_str(), string.size() ); + type == TextDocument::FindReplaceType::Normal + ? String::BMH::createOccTable( (const unsigned char*)string.c_str(), string.size() ) + : std::vector(); for ( auto& file : files ) { pool->run( [findData, file, string, caseSensitive, wholeWord, occ, type] {