diff --git a/bin/assets/i18n/de.xml b/bin/assets/i18n/de.xml
index 6dd25df34..04ba49cad 100644
--- a/bin/assets/i18n/de.xml
+++ b/bin/assets/i18n/de.xml
@@ -373,6 +373,7 @@ Zweignamen eingeben:
Lokalen Zweig erstellen?
Löschen
HEAD-Diff
+ Änderungs-Diff
Stage-Diff
Verwerfen
Alles verwerfen
diff --git a/bin/assets/i18n/en.xml b/bin/assets/i18n/en.xml
index 97081f4e4..36be4506e 100644
--- a/bin/assets/i18n/en.xml
+++ b/bin/assets/i18n/en.xml
@@ -357,6 +357,7 @@ Enter the name for the branch:
Create local branch?
Delete
Diff HEAD
+ Diff Changed
Diff Staged
Discard
Discard All
diff --git a/bin/assets/i18n/fr.xml b/bin/assets/i18n/fr.xml
index 8c53a8b53..b1abe9313 100644
--- a/bin/assets/i18n/fr.xml
+++ b/bin/assets/i18n/fr.xml
@@ -356,6 +356,7 @@ Entrez le nom de la branche :
Créer une branche locale ?
Supprimer
Diff HEAD
+ Diff des modifications
Diff Staged
Annuler
Tout annuler
diff --git a/bin/assets/i18n/zh.xml b/bin/assets/i18n/zh.xml
index 2614e7a91..d347ecc64 100644
--- a/bin/assets/i18n/zh.xml
+++ b/bin/assets/i18n/zh.xml
@@ -277,6 +277,7 @@
Enter the name for the branch:
新建本地分支?
删除
+ 更改差异
Discard
Drop Stash
Drop Stash
diff --git a/include/eepp/core/containers.hpp b/include/eepp/core/containers.hpp
index db0524ed5..f595c0da6 100644
--- a/include/eepp/core/containers.hpp
+++ b/include/eepp/core/containers.hpp
@@ -3,7 +3,8 @@
#include
-#if defined( EEPP_NO_THIRDPARTY_CONTAINERS ) || ( defined( EE_DEBUG ) && defined( EE_COMPILER_MSVC ) )
+#if defined( EEPP_NO_THIRDPARTY_CONTAINERS ) || \
+ ( defined( EE_DEBUG ) && defined( EE_COMPILER_MSVC ) )
#include
#include
#else
@@ -13,9 +14,12 @@
namespace EE {
-#if defined( EEPP_NO_THIRDPARTY_CONTAINERS ) || ( defined( EE_DEBUG ) && defined( EE_COMPILER_MSVC ) )
+#if defined( EEPP_NO_THIRDPARTY_CONTAINERS ) || \
+ ( defined( EE_DEBUG ) && defined( EE_COMPILER_MSVC ) )
-template using UnorderedMap = std::unordered_map;
+template ,
+ typename KeyEqual = std::equal_to>
+using UnorderedMap = std::unordered_map;
template using UnorderedSet = std::unordered_set;
@@ -28,8 +32,9 @@ using SmallUnorderedSet = std::unordered_set;
#else
-template
-using UnorderedMap = ankerl::unordered_dense::map;
+template ,
+ typename KeyEqual = std::equal_to>
+using UnorderedMap = ankerl::unordered_dense::map;
template using UnorderedSet = ankerl::unordered_dense::set;
diff --git a/include/eepp/ui/doc/syntaxcolorscheme.hpp b/include/eepp/ui/doc/syntaxcolorscheme.hpp
index 428a86699..af10c4114 100644
--- a/include/eepp/ui/doc/syntaxcolorscheme.hpp
+++ b/include/eepp/ui/doc/syntaxcolorscheme.hpp
@@ -2,6 +2,7 @@
#define EE_UI_DOC_SYNTAXCOLORSCHEME_HPP
#include
+#include
#include
namespace EE { namespace System {
@@ -317,11 +318,17 @@ class EE_API SyntaxColorScheme {
void setName( const std::string& name );
protected:
- std::string mName;
- UnorderedMap mSyntaxColors;
- UnorderedMap mEditorColors;
+ struct Storage {
+ std::string name;
+ UnorderedMap syntaxColors;
+ UnorderedMap editorColors;
+ };
+
+ std::shared_ptr mStorage;
mutable UnorderedMap mStyleCache;
+ void ensureUniqueStorage();
+
template
const SyntaxColorScheme::Style& getSyntaxStyleFromCache( const SyntaxStyleType& type ) const;
};
diff --git a/include/eepp/ui/doc/syntaxdefinitionmanager.hpp b/include/eepp/ui/doc/syntaxdefinitionmanager.hpp
index 328807d7f..50256903e 100644
--- a/include/eepp/ui/doc/syntaxdefinitionmanager.hpp
+++ b/include/eepp/ui/doc/syntaxdefinitionmanager.hpp
@@ -2,12 +2,14 @@
#define EE_UI_DOC_SYNTAXSTYLEMANAGER_HPP
#include
+#include
#include
#include
#include
#include
#include
#include
+#include
#include
namespace EE { namespace System {
@@ -127,6 +129,7 @@ class EE_API SyntaxDefinitionManager {
std::vector> mDefinitions;
std::vector mPreDefinitions;
std::map mPriorities;
+ mutable UnorderedMap mExtensionManyLanguagesCache;
FileAssociations mFileAssociations;
mutable Mutex mMutex;
mutable Mutex mFileAssociationsMutex;
diff --git a/include/eepp/ui/doc/textdocument.hpp b/include/eepp/ui/doc/textdocument.hpp
index ca9fe702c..86b30a6cc 100644
--- a/include/eepp/ui/doc/textdocument.hpp
+++ b/include/eepp/ui/doc/textdocument.hpp
@@ -22,6 +22,7 @@
#include
#include
#include
+#include
#include
using namespace EE::System;
@@ -132,6 +133,7 @@ class EE_API TextDocument {
typedef std::function DocumentCommand;
typedef std::function DocumentRefCommand;
+ typedef UnorderedMap DocumentRefCommands;
TextDocument( bool verbose = true );
@@ -450,6 +452,9 @@ class EE_API TextDocument {
void setCommand( const std::string& command, const DocumentRefCommand& func );
+ /** Installs an immutable command table shared by documents with the same client type. */
+ void setSharedRefCommands( std::shared_ptr commands );
+
bool hasCommand( const std::string& command );
bool removeCommand( const std::string& command );
@@ -818,6 +823,8 @@ class EE_API TextDocument {
Uint32 mPageSize{ 10 };
UnorderedMap mCommands;
UnorderedMap mRefCommands;
+ std::shared_ptr mSharedRefCommands;
+ std::unique_ptr> mRemovedDefaultCommands;
String mNonWordChars;
Client* mActiveClient{ nullptr };
mutable Mutex mLoadingMutex;
@@ -831,6 +838,12 @@ class EE_API TextDocument {
void initializeCommands();
+ using BuiltinDocumentCommand = void ( * )( TextDocument* );
+
+ static const UnorderedMap& getBuiltinCommands();
+
+ bool isDefaultCommandRemoved( const std::string& command ) const;
+
void cleanChangeId();
void notifyDocumentLoaded();
diff --git a/include/eepp/ui/keyboardshortcut.hpp b/include/eepp/ui/keyboardshortcut.hpp
index b448e1e34..55f0abbc4 100644
--- a/include/eepp/ui/keyboardshortcut.hpp
+++ b/include/eepp/ui/keyboardshortcut.hpp
@@ -2,8 +2,10 @@
#define EE_UI_KEYBOARDSHORTCUT_HPP
#include
+#include
#include
#include