diff --git a/bin/assets/ui/breeze.css b/bin/assets/ui/breeze.css
index c86964b9a..6cc7ca0a8 100644
--- a/bin/assets/ui/breeze.css
+++ b/bin/assets/ui/breeze.css
@@ -540,15 +540,19 @@ Tab::close {
width: 10dp;
height: 10dp;
border-radius: 5dp;
- background-color: var(--tab-close);
+ /*background-color: var(--tab-close);
foreground-image: poly(line, var(--icon-line-hover), "0dp 0dp, 5dp 5dp"), poly(line, var(--icon-line-hover), "5dp 0dp, 0dp 5dp");
- foreground-position: 2.5dp 2.5dp, 2.5dp 2.5dp;
+ foreground-position: 2.5dp 2.5dp, 2.5dp 2.5dp;*/
+ foreground-image: url("data:image/svg,");
+ foreground-tint: var(--tab-close);
+ foreground-size: 10dp 10dp;
margin-right: 4dp;
transition: all 0.15s;
}
Tab::close:hover {
- background-color: var(--tab-close-hover);
+ /*background-color: var(--tab-close-hover);*/
+ foreground-tint: var(--tab-close-hover);
}
Loader {
diff --git a/include/eepp/ui/doc/syntaxcolorscheme.hpp b/include/eepp/ui/doc/syntaxcolorscheme.hpp
index feea1955a..8586042b5 100644
--- a/include/eepp/ui/doc/syntaxcolorscheme.hpp
+++ b/include/eepp/ui/doc/syntaxcolorscheme.hpp
@@ -79,6 +79,7 @@ class EE_API SyntaxColorScheme {
std::string mName;
std::unordered_map mSyntaxColors;
std::unordered_map mEditorColors;
+ mutable std::unordered_map mStyleCache;
};
}}} // namespace EE::UI::Doc
diff --git a/include/eepp/ui/doc/syntaxdefinitionmanager.hpp b/include/eepp/ui/doc/syntaxdefinitionmanager.hpp
index 7833bcb4a..3ac41e79a 100644
--- a/include/eepp/ui/doc/syntaxdefinitionmanager.hpp
+++ b/include/eepp/ui/doc/syntaxdefinitionmanager.hpp
@@ -141,6 +141,8 @@ class EE_API SyntaxDefinitionManager {
void addPO();
void addPerl();
+
+ void addxit();
};
}}} // namespace EE::UI::Doc
diff --git a/premake4.lua b/premake4.lua
index 874a54a0d..3e85452f4 100644
--- a/premake4.lua
+++ b/premake4.lua
@@ -161,6 +161,7 @@ newoption { trigger = "with-mojoal", description = "Compile with mojoAL as OpenA
newoption { trigger = "use-frameworks", description = "In macOS it will try to link the external libraries from its frameworks. For example, instead of linking against SDL2 it will link agains SDL2.framework." }
newoption { trigger = "with-emscripten-pthreads", description = "Enables emscripten build to use posix threads" }
newoption { trigger = "with-mold-linker", description = "Tries to use the mold linker instead of the default linker of the toolchain" }
+newoption { trigger = "with-debug-symbols", description = "Release builds are built with debug symbols." }
newoption {
trigger = "with-backend",
description = "Select the backend to use for window and input handling.\n\t\t\tIf no backend is selected or if the selected is not installed the script will search for a backend present in the system, and will use it.",
@@ -324,6 +325,9 @@ function build_base_configuration( package_name )
configuration "release"
defines { "NDEBUG" }
flags { "OptimizeSpeed" }
+ if _OPTIONS["with-debug-symbols"] then
+ flags { "Symbols" }
+ end
if not is_vs() then
buildoptions{ "-Wall", "-std=gnu99" }
end
@@ -361,6 +365,9 @@ function build_base_cpp_configuration( package_name )
configuration "release"
defines { "NDEBUG" }
flags { "OptimizeSpeed" }
+ if _OPTIONS["with-debug-symbols"] then
+ flags { "Symbols" }
+ end
if not is_vs() then
buildoptions{ "-Wall" }
end
@@ -521,6 +528,9 @@ function build_link_configuration( package_name, use_ee_icon )
configuration "release"
defines { "NDEBUG" }
flags { "OptimizeSpeed" }
+ if _OPTIONS["with-debug-symbols"] then
+ flags { "Symbols" }
+ end
if not is_vs() and not os.is_real("emscripten") then
buildoptions { "-fno-strict-aliasing -ffast-math" }
@@ -1196,6 +1206,9 @@ solution "eepp"
configuration "release"
defines { "NDEBUG" }
flags { "OptimizeSpeed" }
+ if _OPTIONS["with-debug-symbols"] then
+ flags { "Symbols" }
+ end
buildoptions{ "-O3" }
targetname ( "ecode-macos-helper-static" )
end
@@ -1214,7 +1227,12 @@ solution "eepp"
links { "ecode-macos-helper-static" }
end
if os.is_real("linux") then
- links { "util" }
+ if _OPTIONS["with-debug-symbols"] then
+ defines { "ECODE_USE_BACKWARD" }
+ links { "util", "bfd", "dw", "dl" }
+ else
+ links { "util" }
+ end
end
if os.is("haiku") then
links { "bsd" }
diff --git a/premake5.lua b/premake5.lua
index 159e873c3..584a941e5 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -10,6 +10,7 @@ newoption { trigger = "windows-vc-build", description = "This is used to build t
newoption { trigger = "windows-mingw-build", description = "This is used to build the framework with mingw downloading its external dependencies." }
newoption { trigger = "with-emscripten-pthreads", description = "Enables emscripten build to use posix threads" }
newoption { trigger = "with-mold-linker", description = "Tries to use the mold linker instead of the default linker of the toolchain" }
+newoption { trigger = "with-debug-symbols", description = "Release builds are built with debug symbols." }
newoption {
trigger = "with-backend",
description = "Select the backend to use for window and input handling.\n\t\t\tIf no backend is selected or if the selected is not installed the script will search for a backend present in the system, and will use it.",
@@ -201,6 +202,9 @@ function build_base_cpp_configuration( package_name )
filter "configurations:release*"
optimize "Speed"
+ if _OPTIONS["with-debug-symbols"] then
+ symbols "On"
+ end
targetname ( package_name )
filter "system:emscripten"
@@ -653,6 +657,9 @@ workspace "eepp"
symbols "On"
filter "configurations:release*"
optimize "Speed"
+ if _OPTIONS["with-debug-symbols"] then
+ symbols "On"
+ end
filter { "system:windows", "action:vs*" }
flags { "MultiProcessorCompile" }
@@ -938,6 +945,9 @@ workspace "eepp"
filter { "configurations:release*", "action:not vs*" }
defines { "NDEBUG" }
optimize "Speed"
+ if _OPTIONS["with-debug-symbols"] then
+ symbols "On"
+ end
targetname ( "ecode-macos-helper-static" )
project "ecode"
@@ -953,7 +963,12 @@ workspace "eepp"
filter { "system:not windows", "system:not haiku" }
links { "pthread" }
filter "system:linux"
- links { "util" }
+ if _OPTIONS["with-debug-symbols"] then
+ defines { "ECODE_USE_BACKWARD" }
+ links { "util", "bfd", "dw", "dl" }
+ else
+ links { "util" }
+ end
filter "system:haiku"
links { "bsd" }
diff --git a/src/eepp/graphics/drawablesearcher.cpp b/src/eepp/graphics/drawablesearcher.cpp
index e4829b3d6..c5fb55b05 100644
--- a/src/eepp/graphics/drawablesearcher.cpp
+++ b/src/eepp/graphics/drawablesearcher.cpp
@@ -74,6 +74,8 @@ static Drawable* parseDataURI( const std::string& name ) {
Uint32 texId = 0;
if ( !format.empty() &&
( Image::isImageExtension( "." + format ) || format == "svg+xml" ) ) {
+ Image::FormatConfiguration format;
+ format.svgScale( PixelDensity::getPixelDensity() );
if ( decodingType == "base64" ) {
int fileStart = formatAndEncSep + 1;
int base64Size = name.size() - fileStart;
@@ -83,13 +85,17 @@ static Drawable* parseDataURI( const std::string& name ) {
ScopedBuffer buffer( bufSize );
int len = Base64::decode( base64Size, &name[fileStart], bufSize, buffer.get() );
if ( len > 0 )
- texId = TextureFactory::instance()->loadFromMemory( buffer.get(), len );
+ texId = TextureFactory::instance()->loadFromMemory(
+ buffer.get(), len, false, Texture::ClampMode::ClampToEdge, false, false,
+ format );
} else if ( decodingType == "urldecode" ) {
int fileStart = formatAndEncSep + 1;
std::string decoded( URI::decode( name.substr( fileStart ) ) );
- if ( !decoded.empty() )
+ if ( !decoded.empty() ) {
texId = TextureFactory::instance()->loadFromMemory(
- (const unsigned char*)decoded.c_str(), decoded.size() );
+ (const unsigned char*)decoded.c_str(), decoded.size(), false,
+ Texture::ClampMode::ClampToEdge, false, false, format );
+ }
}
}
diff --git a/src/eepp/ui/doc/syntaxcolorscheme.cpp b/src/eepp/ui/doc/syntaxcolorscheme.cpp
index cf8973dc6..0173354fc 100644
--- a/src/eepp/ui/doc/syntaxcolorscheme.cpp
+++ b/src/eepp/ui/doc/syntaxcolorscheme.cpp
@@ -80,6 +80,53 @@ SyntaxColorScheme SyntaxColorScheme::getDefault() {
{ "minimap_visible_area", Color( "#FFFFFF0A" ) } } };
}
+SyntaxColorScheme::Style parseStyle(
+ const std::string& value, bool* colorWasSet = nullptr,
+ const std::unordered_map* syntaxColors = nullptr ) {
+ auto values = String::split( value, ',' );
+ SyntaxColorScheme::Style style;
+ bool colorSet = false;
+ for ( auto& val : values ) {
+ String::toLowerInPlace( val );
+ String::trimInPlace( val );
+ if ( Color::isColorString( val ) ) {
+ if ( !colorSet ) {
+ style.color = Color::fromString( val );
+ colorSet = true;
+ } else {
+ style.background = Color::fromString( val );
+ }
+ } else {
+ if ( "regular" == val )
+ style.style |= Text::Regular;
+ else if ( "bold" == val )
+ style.style |= Text::Bold;
+ else if ( "italic" == val )
+ style.style |= Text::Italic;
+ else if ( "underline" == val || "underlined" == val )
+ style.style |= Text::Underlined;
+ else if ( "strikethrough" == val )
+ style.style |= Text::StrikeThrough;
+ else if ( "shadow" == val )
+ style.style |= Text::Shadow;
+ else if ( syntaxColors &&
+ ( "normal" == val || "symbol" == val || "comment" == val ||
+ "keyword" == val || "keyword2" == val || "number" == val ||
+ "literal" == val || "string" == val || "opetaror" == val ||
+ "function" == val || "link" == val || "link_hover" == val ) ) {
+ auto styleIt = ( *syntaxColors ).find( val );
+ if ( styleIt != ( *syntaxColors ).end() ) {
+ style = styleIt->second;
+ colorSet = true;
+ }
+ }
+ }
+ }
+ if ( colorWasSet )
+ *colorWasSet = colorSet;
+ return style;
+}
+
std::vector SyntaxColorScheme::loadFromStream( IOStream& stream ) {
Clock clock;
std::vector colorSchemes;
@@ -94,41 +141,13 @@ std::vector SyntaxColorScheme::loadFromStream( IOStream& stre
std::string valueName( String::toLower( ini.getValueName( keyIdx, valueIdx ) ) );
std::string value( ini.getValue( keyIdx, valueIdx ) );
if ( !value.empty() ) {
- auto values = String::split( value, ',' );
- SyntaxColorScheme::Style style;
- bool colorSet = false;
- for ( auto& val : values ) {
- String::toLowerInPlace( val );
- String::trimInPlace( val );
- if ( Color::isColorString( val ) ) {
- if ( !colorSet ) {
- style.color = Color::fromString( val );
- colorSet = true;
- } else {
- style.background = Color::fromString( val );
- }
- } else {
- if ( "regular" == val )
- style.style |= Text::Regular;
- else if ( "bold" == val )
- style.style |= Text::Bold;
- else if ( "italic" == val )
- style.style |= Text::Italic;
- else if ( "underline" == val || "underlined" == val )
- style.style |= Text::Underlined;
- else if ( "strikethrough" == val )
- style.style |= Text::StrikeThrough;
- else if ( "shadow" == val )
- style.style |= Text::Shadow;
- }
-
- if ( refColorScheme.mSyntaxColors.find( valueName ) !=
- refColorScheme.mSyntaxColors.end() ) {
- colorScheme.setSyntaxStyle( valueName, style );
- } else if ( refColorScheme.mEditorColors.find( valueName ) !=
- refColorScheme.mEditorColors.end() ) {
- colorScheme.setEditorSyntaxStyle( valueName, style );
- }
+ SyntaxColorScheme::Style style = parseStyle( value );
+ if ( refColorScheme.mSyntaxColors.find( valueName ) !=
+ refColorScheme.mSyntaxColors.end() ) {
+ colorScheme.setSyntaxStyle( valueName, style );
+ } else if ( refColorScheme.mEditorColors.find( valueName ) !=
+ refColorScheme.mEditorColors.end() ) {
+ colorScheme.setEditorSyntaxStyle( valueName, style );
}
}
}
@@ -184,6 +203,20 @@ const SyntaxColorScheme::Style& SyntaxColorScheme::getSyntaxStyle( const std::st
return it->second;
else if ( type == "link" || type == "link_hover" )
return getSyntaxStyle( "function" );
+ else {
+ auto foundIt = mStyleCache.find( type );
+ if ( foundIt != mStyleCache.end() )
+ return foundIt->second;
+ bool colorWasSet;
+ mStyleCache[type] = parseStyle( type, &colorWasSet, &mSyntaxColors );
+ if ( !colorWasSet ) {
+ auto normalStyle = mSyntaxColors.find( "normal" );
+ if ( normalStyle != mSyntaxColors.end() ) {
+ mStyleCache[type].color = normalStyle->second.color;
+ }
+ }
+ return mStyleCache[type];
+ }
return StyleEmpty;
}
@@ -254,5 +287,4 @@ const std::string& SyntaxColorScheme::getName() const {
void SyntaxColorScheme::setName( const std::string& name ) {
mName = name;
}
-
}}} // namespace EE::UI::Doc
diff --git a/src/eepp/ui/doc/syntaxdefinitionmanager.cpp b/src/eepp/ui/doc/syntaxdefinitionmanager.cpp
index d1e20c199..99dfd51f5 100644
--- a/src/eepp/ui/doc/syntaxdefinitionmanager.cpp
+++ b/src/eepp/ui/doc/syntaxdefinitionmanager.cpp
@@ -118,6 +118,8 @@ SyntaxDefinitionManager::SyntaxDefinitionManager() {
addPO();
addPerl();
+
+ addxit();
}
void SyntaxDefinitionManager::addPlainText() {
@@ -138,9 +140,9 @@ void SyntaxDefinitionManager::addXML() {
{ { "0x[%da-fA-F]+" }, "number" },
{ { "-?%d+[%d%.]*f?" }, "number" },
{ { "-?%.?%d+f?" }, "number" },
- { { "%f[^<]![%a_][%w_-]*" }, "keyword2" },
- { { "%f[^<][%a_][%w_-]*" }, "function" },
- { { "%f[^<]/[%a_][%w_-]*" }, "function" },
+ { { "%f[^<]![%a_][%w%_%-]*" }, "keyword2" },
+ { { "%f[^<][%a_][%w%_%-]*" }, "function" },
+ { { "%f[^<]/[%a_][%w%_%-]*" }, "function" },
{ { "[%a_][%w_]*" }, "keyword" },
{ { "[/<>=]" }, "operator" },
},
@@ -172,9 +174,9 @@ void SyntaxDefinitionManager::addHTML() {
{ { "0x[%da-fA-F]+" }, "number" },
{ { "-?%d+[%d%.]*f?" }, "number" },
{ { "-?%.?%d+f?" }, "number" },
- { { "%f[^<]![%a_][%w_-]*" }, "keyword2" },
- { { "%f[^<][%a_][%w_-]*" }, "function" },
- { { "%f[^<]/[%a_][%w_-]*" }, "function" },
+ { { "%f[^<]![%a_][%w%_%-]*" }, "keyword2" },
+ { { "%f[^<][%a_][%w%_%-]*" }, "function" },
+ { { "%f[^<]/[%a_][%w%_%-]*" }, "function" },
{ { "[%a_][%w_]*" }, "keyword" },
{ { "[/<>=]" }, "operator" },
},
@@ -192,16 +194,16 @@ void SyntaxDefinitionManager::addCSS() {
{ { "/%*", "%*/" }, "comment" },
{ { "\"", "\"", "\\" }, "string" },
{ { "'", "'", "\\" }, "string" },
- { { "^%s*#[%a_-][%w_-]*" }, "keyword2" },
- { { ",%s*#[%a_-][%w_-]*" }, "keyword2" },
- { { "#%x%x?%x?%x?%x?%x?x?x?" }, "string" },
- { { "#[%a_-][%w_-]*" }, "keyword2" },
- { { "%-%-%a[%w-_]*" }, "keyword2" },
+ { { "^%s*#[%a%_%-][%w%_%-]*" }, "keyword2" },
+ { { ",%s*#[%a%_%-][%w%_%-]*" }, "keyword2" },
+ { { "#%x%x?%x?%x?%x?%x?%x?%x?" }, "string" },
+ { { "#[%a%_%-][%w%_%-]*" }, "keyword2" },
+ { { "%-%-%a[%w%-%_]*" }, "keyword2" },
{ { "-?%d+[%d%.]*p[xt]" }, "number" },
{ { "-?%d+[%d%.]*deg" }, "number" },
{ { "-?%d+[%d%.]*" }, "number" },
- { { "@[%a][%w_-]*" }, "keyword2" },
- { { "%.[%a_-][%w_-]*" }, "keyword2" },
+ { { "@[%a][%w%_%-]*" }, "keyword2" },
+ { { "%.[%a%_%-][%w%_%-]*" }, "keyword2" },
{ { "(:)(hover)" }, { "normal", "operator", "literal" } },
{ { "(:)(focus)" }, { "normal", "operator", "literal" } },
{ { "(:)(selectedpressed)" }, { "normal", "operator", "literal" } },
@@ -510,7 +512,7 @@ void SyntaxDefinitionManager::addBash() {
{ { "`", "`", "\\" }, "string" },
{ { "%f[%w_][%d%.]+%f[^%w_]" }, "number" },
{ { "[!<>|&%[%]=*]" }, "operator" },
- { { "%f[%S]%-[%w%-_]+" }, "function" },
+ { { "%f[%S]%-[%w%-%_]+" }, "function" },
{ { "${.*}" }, "keyword2" },
{ { "$[%a_@*][%w_]*" }, "keyword2" },
{ { "[%a_][%w_]*" }, "symbol" },
@@ -2989,7 +2991,7 @@ void SyntaxDefinitionManager::addPowerShell() {
{ { "'", "'" }, "string" },
{ { "%f[%w_][%d%.]+%f[^%w_]" }, "number" },
{ { "[%+=/%*%^%%<>!~|&,:]+" }, "operator" },
- { { "%f[%S]%-[%w%-_]+" }, "function" },
+ { { "%f[%S]%-[%w%-%_]+" }, "function" },
{ { "[%u][%a]+[%-][%u][%a]+" }, "function" },
{ { "${.*}" }, "symbol" },
{ { "$[%a_@*][%w_]*" }, "keyword2" },
@@ -3076,7 +3078,7 @@ void SyntaxDefinitionManager::addWren() {
void SyntaxDefinitionManager::addEnv() {
add( { "Environment File",
- { "%.env$", "%.env.[%w-_]*$" },
+ { "%.env$", "%.env.[%w%-%_]*$" },
{ { { "^#.-\n" }, "comment" },
{ { "%s#.-\n" }, "comment" },
{ { "\\[nrtfb\\\"']" }, "literal" },
@@ -3526,6 +3528,40 @@ void SyntaxDefinitionManager::addPerl() {
} );
}
+void SyntaxDefinitionManager::addxit() {
+ add( {
+ "[x]it!",
+ { "%.xit$" },
+ {
+ { { "%f[^%s%(]%-%>%s%d%d%d%d%-%d%d%-%d%d%f[\n%s%!%?%)]" }, "number" },
+ { { "%f[^%s%(]%-%>%s%d%d%d%d%/%d%d%/%d%d%f[\n%s%!%?%)]" }, "number" },
+ { { "%f[^%s%(]%-%>%s%d%d%d%d%-[wWqQ]?%d%d?%f[\n%s%!%?%)]" }, "number" },
+ { { "%f[^%s%(]%-%>%s%d%d%d%d%/[wWqQ]?%d%d?%f[\n%s%!%?%)]" }, "number" },
+ { { "%f[^%s%(]%-%>%s%d%d%d%d%f[\n%s%!%?%)]" }, "number" },
+ { { "^(%[%s%]%s)([%.!]+)%s" }, { "operator", "operator", "red" } },
+ { { "^(%[x%]%s)([%.!]+)%s" }, { "function", "function", "red" } },
+ { { "^(%[@%]%s)([%.!]+)%s" }, { "keyword", "keyword", "red" } },
+ { { "^(%[~%]%s)([%.!]+)%s" }, { "comment", "comment", "red" } },
+ { { "%#[%wñàáâãäåèéêëìíîïòóôõöùúûüýÿÑÀÁÂÃÄÅÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝ%-%_]+%=\"", "\"" },
+ "string" },
+ { { "%#[%wñàáâãäåèéêëìíîïòóôõöùúûüýÿÑÀÁÂÃÄÅÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝ%-%_]+%='", "'" },
+ "string" },
+ { { "%#[%wñàáâãäåèéêëìíîïòóôõöùúûüýÿÑÀÁÂÃÄÅÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝ%-%_]+%=[%w%-%_]*" },
+ "string" },
+ { { "%#[%wñàáâãäåèéêëìíîïòóôõöùúûüýÿÑÀÁÂÃÄÅÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝ%-%_]+" }, "string" },
+ { { "^%[%s%]%s" }, "operator" },
+ { { "^%[x%]%s" }, "function" },
+ { { "^%[@%]%s" }, "keyword" },
+ { { "^%[~%]%s" }, "comment" },
+ { { "^[%wñàáâãäåèéêëìíîïòóôõöùúûüýÿÑÀÁÂÃÄÅÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝ][%w"
+ "ñàáâãäåèéêëìíîïòóôõöùúûüýÿÑÀÁÂÃÄÅÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝ%s%p]*%f[\n]" },
+ "underline" },
+ },
+ {},
+ "",
+ } );
+}
+
SyntaxDefinition& SyntaxDefinitionManager::add( SyntaxDefinition&& syntaxStyle ) {
mStyles.emplace_back( std::move( syntaxStyle ) );
return mStyles.back();
diff --git a/src/eepp/ui/doc/syntaxhighlighter.cpp b/src/eepp/ui/doc/syntaxhighlighter.cpp
index 03c4e817e..9565f97bb 100644
--- a/src/eepp/ui/doc/syntaxhighlighter.cpp
+++ b/src/eepp/ui/doc/syntaxhighlighter.cpp
@@ -64,6 +64,8 @@ Int64 SyntaxHighlighter::getMaxWantedLine() const {
}
bool SyntaxHighlighter::updateDirty( int visibleLinesCount ) {
+ if ( visibleLinesCount <= 0 )
+ return 0;
if ( mFirstInvalidLine > mMaxWantedLine ) {
mMaxWantedLine = 0;
} else {
diff --git a/src/eepp/ui/doc/textdocument.cpp b/src/eepp/ui/doc/textdocument.cpp
index 2d5ac3f3f..044815508 100644
--- a/src/eepp/ui/doc/textdocument.cpp
+++ b/src/eepp/ui/doc/textdocument.cpp
@@ -174,6 +174,10 @@ TextDocument::LoadStatus TextDocument::loadFromStream( IOStream& file, std::stri
clock.getElapsedTime().asMilliseconds() );
bool wasInterrupted = !mLoading;
+ if ( wasInterrupted ) {
+ mLines.clear();
+ mLines.push_back( String( "\n" ) );
+ }
mLoading = false;
return wasInterrupted ? LoadStatus::Interrupted
: ( file.isOpen() ? LoadStatus::Loaded : LoadStatus::Failed );
@@ -334,7 +338,7 @@ bool TextDocument::loadAsyncFromFile( const std::string& path, std::shared_ptr onLoaded ) {
mLoading = true;
pool->run(
- [&, path, onLoaded] {
+ [this, path, onLoaded] {
auto loaded = loadFromFile( path );
if ( loaded != LoadStatus::Interrupted && onLoaded )
onLoaded( this, loaded == LoadStatus::Loaded );
@@ -1387,7 +1391,7 @@ bool TextDocument::isSaving() const {
}
TextPosition TextDocument::sanitizePosition( const TextPosition& position ) const {
- Int64 line = eeclamp( position.line(), 0UL, mLines.size() - 1 );
+ Int64 line = eeclamp( position.line(), 0UL, mLines.size() ? mLines.size() - 1 : 0 );
Int64 col =
eeclamp( position.column(), 0UL, eemax( 0, mLines[line].size() - 1 ) );
return { line, col };
diff --git a/src/eepp/ui/keyboardshortcut.cpp b/src/eepp/ui/keyboardshortcut.cpp
index 0844758f6..c3fb032c2 100644
--- a/src/eepp/ui/keyboardshortcut.cpp
+++ b/src/eepp/ui/keyboardshortcut.cpp
@@ -152,6 +152,7 @@ std::string KeyBindings::getCommandKeybindString( const std::string& command ) c
void KeyBindings::reset() {
mShortcuts.clear();
+ mKeybindingsInvert.clear();
}
const ShortcutMap& KeyBindings::getShortcutMap() const {
diff --git a/src/eepp/ui/uicodeeditor.cpp b/src/eepp/ui/uicodeeditor.cpp
index c9397c1d6..2537de9a6 100644
--- a/src/eepp/ui/uicodeeditor.cpp
+++ b/src/eepp/ui/uicodeeditor.cpp
@@ -330,7 +330,7 @@ void UICodeEditor::scheduledUpdate( const Time& ) {
if ( !mVisible )
return;
- if ( mHighlighter.updateDirty( getVisibleLinesCount() ) ) {
+ if ( mDoc && !mDoc->isLoading() && mHighlighter.updateDirty( getVisibleLinesCount() ) ) {
invalidateDraw();
}
diff --git a/src/eepp/ui/uinodedrawable.cpp b/src/eepp/ui/uinodedrawable.cpp
index d74c81d0f..e95c6fedb 100644
--- a/src/eepp/ui/uinodedrawable.cpp
+++ b/src/eepp/ui/uinodedrawable.cpp
@@ -310,6 +310,7 @@ void UINodeDrawable::LayerDrawable::draw( const Vector2f& position, const Sizef&
if ( mNeedsUpdate )
update();
+ RGB prevColor = getColorFilter();
if ( mColorWasSet )
mDrawable->setColorFilter( getColor() );
mDrawable->setAlpha( getAlpha() );
@@ -357,6 +358,8 @@ void UINodeDrawable::LayerDrawable::draw( const Vector2f& position, const Sizef&
break;
}
}
+ if ( mColorWasSet )
+ mDrawable->setColorFilter( prevColor );
}
Sizef UINodeDrawable::LayerDrawable::getSize() {
diff --git a/src/thirdparty/backward-cpp/backward.hpp b/src/thirdparty/backward-cpp/backward.hpp
new file mode 100644
index 000000000..9e0c4369f
--- /dev/null
+++ b/src/thirdparty/backward-cpp/backward.hpp
@@ -0,0 +1,4476 @@
+/*
+ * backward.hpp
+ * Copyright 2013 Google Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef H_6B9572DA_A64B_49E6_B234_051480991C89
+#define H_6B9572DA_A64B_49E6_B234_051480991C89
+
+#ifndef __cplusplus
+#error "It's not going to compile without a C++ compiler..."
+#endif
+
+#if defined(BACKWARD_CXX11)
+#elif defined(BACKWARD_CXX98)
+#else
+#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
+#define BACKWARD_CXX11
+#define BACKWARD_ATLEAST_CXX11
+#define BACKWARD_ATLEAST_CXX98
+#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
+#define BACKWARD_ATLEAST_CXX17
+#endif
+#else
+#define BACKWARD_CXX98
+#define BACKWARD_ATLEAST_CXX98
+#endif
+#endif
+
+// You can define one of the following (or leave it to the auto-detection):
+//
+// #define BACKWARD_SYSTEM_LINUX
+// - specialization for linux
+//
+// #define BACKWARD_SYSTEM_DARWIN
+// - specialization for Mac OS X 10.5 and later.
+//
+// #define BACKWARD_SYSTEM_WINDOWS
+// - specialization for Windows (Clang 9 and MSVC2017)
+//
+// #define BACKWARD_SYSTEM_UNKNOWN
+// - placebo implementation, does nothing.
+//
+#if defined(BACKWARD_SYSTEM_LINUX)
+#elif defined(BACKWARD_SYSTEM_DARWIN)
+#elif defined(BACKWARD_SYSTEM_UNKNOWN)
+#elif defined(BACKWARD_SYSTEM_WINDOWS)
+#else
+#if defined(__linux) || defined(__linux__)
+#define BACKWARD_SYSTEM_LINUX
+#elif defined(__APPLE__)
+#define BACKWARD_SYSTEM_DARWIN
+#elif defined(_WIN32)
+#define BACKWARD_SYSTEM_WINDOWS
+#else
+#define BACKWARD_SYSTEM_UNKNOWN
+#endif
+#endif
+
+#define NOINLINE __attribute__((noinline))
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#if defined(BACKWARD_SYSTEM_LINUX)
+
+// On linux, backtrace can back-trace or "walk" the stack using the following
+// libraries:
+//
+// #define BACKWARD_HAS_UNWIND 1
+// - unwind comes from libgcc, but I saw an equivalent inside clang itself.
+// - with unwind, the stacktrace is as accurate as it can possibly be, since
+// this is used by the C++ runtime in gcc/clang for stack unwinding on
+// exception.
+// - normally libgcc is already linked to your program by default.
+//
+// #define BACKWARD_HAS_LIBUNWIND 1
+// - libunwind provides, in some cases, a more accurate stacktrace as it knows
+// to decode signal handler frames and lets us edit the context registers when
+// unwinding, allowing stack traces over bad function references.
+//
+// #define BACKWARD_HAS_BACKTRACE == 1
+// - backtrace seems to be a little bit more portable than libunwind, but on
+// linux, it uses unwind anyway, but abstract away a tiny information that is
+// sadly really important in order to get perfectly accurate stack traces.
+// - backtrace is part of the (e)glib library.
+//
+// The default is:
+// #define BACKWARD_HAS_UNWIND == 1
+//
+// Note that only one of the define should be set to 1 at a time.
+//
+#if BACKWARD_HAS_UNWIND == 1
+#elif BACKWARD_HAS_LIBUNWIND == 1
+#elif BACKWARD_HAS_BACKTRACE == 1
+#else
+#undef BACKWARD_HAS_UNWIND
+#define BACKWARD_HAS_UNWIND 1
+#undef BACKWARD_HAS_LIBUNWIND
+#define BACKWARD_HAS_LIBUNWIND 0
+#undef BACKWARD_HAS_BACKTRACE
+#define BACKWARD_HAS_BACKTRACE 0
+#endif
+
+// On linux, backward can extract detailed information about a stack trace
+// using one of the following libraries:
+//
+// #define BACKWARD_HAS_DW 1
+// - libdw gives you the most juicy details out of your stack traces:
+// - object filename
+// - function name
+// - source filename
+// - line and column numbers
+// - source code snippet (assuming the file is accessible)
+// - variable names (if not optimized out)
+// - variable values (not supported by backward-cpp)
+// - You need to link with the lib "dw":
+// - apt-get install libdw-dev
+// - g++/clang++ -ldw ...
+//
+// #define BACKWARD_HAS_BFD 1
+// - With libbfd, you get a fair amount of details:
+// - object filename
+// - function name
+// - source filename
+// - line numbers
+// - source code snippet (assuming the file is accessible)
+// - You need to link with the lib "bfd":
+// - apt-get install binutils-dev
+// - g++/clang++ -lbfd ...
+//
+// #define BACKWARD_HAS_DWARF 1
+// - libdwarf gives you the most juicy details out of your stack traces:
+// - object filename
+// - function name
+// - source filename
+// - line and column numbers
+// - source code snippet (assuming the file is accessible)
+// - variable names (if not optimized out)
+// - variable values (not supported by backward-cpp)
+// - You need to link with the lib "dwarf":
+// - apt-get install libdwarf-dev
+// - g++/clang++ -ldwarf ...
+//
+// #define BACKWARD_HAS_BACKTRACE_SYMBOL 1
+// - backtrace provides minimal details for a stack trace:
+// - object filename
+// - function name
+// - backtrace is part of the (e)glib library.
+//
+// The default is:
+// #define BACKWARD_HAS_BACKTRACE_SYMBOL == 1
+//
+// Note that only one of the define should be set to 1 at a time.
+//
+#if BACKWARD_HAS_DW == 1
+#elif BACKWARD_HAS_BFD == 1
+#elif BACKWARD_HAS_DWARF == 1
+#elif BACKWARD_HAS_BACKTRACE_SYMBOL == 1
+#else
+#undef BACKWARD_HAS_DW
+#define BACKWARD_HAS_DW 0
+#undef BACKWARD_HAS_BFD
+#define BACKWARD_HAS_BFD 0
+#undef BACKWARD_HAS_DWARF
+#define BACKWARD_HAS_DWARF 0
+#undef BACKWARD_HAS_BACKTRACE_SYMBOL
+#define BACKWARD_HAS_BACKTRACE_SYMBOL 1
+#endif
+
+#include
+#include
+#ifdef __ANDROID__
+// Old Android API levels define _Unwind_Ptr in both link.h and
+// unwind.h Rename the one in link.h as we are not going to be using
+// it
+#define _Unwind_Ptr _Unwind_Ptr_Custom
+#include
+#undef _Unwind_Ptr
+#else
+#include
+#endif
+#if defined(__ppc__) || defined(__powerpc) || defined(__powerpc__) || \
+ defined(__POWERPC__)
+// Linux kernel header required for the struct pt_regs definition
+// to access the NIP (Next Instruction Pointer) register value
+#include
+#endif
+#include
+#include
+#include
+#include
+
+#if BACKWARD_HAS_BFD == 1
+// NOTE: defining PACKAGE{,_VERSION} is required before including
+// bfd.h on some platforms, see also:
+// https://sourceware.org/bugzilla/show_bug.cgi?id=14243
+#ifndef PACKAGE
+#define PACKAGE
+#endif
+#ifndef PACKAGE_VERSION
+#define PACKAGE_VERSION
+#endif
+#include
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#include
+#undef _GNU_SOURCE
+#else
+#include
+#endif
+#endif
+
+#if BACKWARD_HAS_DW == 1
+#include
+#include
+#include
+#endif
+
+#if BACKWARD_HAS_DWARF == 1
+#include
+#include
+#include
+#include
+#include