mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-10-18 11:33:23 +03:00
Optimize editor initialization and multi-file diff loading
- Share immutable built-in document commands, editor command tables, default keybindings, and syntax color scheme storage across editor instances. Preserve mutations through copy-on-write storage and explicit command-removal tracking. - Use ShortcutMap consistently with unordered lookup while retaining deterministic ordering where serialization or conflict resolution depends on it. Cache ambiguous syntax-extension checks and invalidate the cache when language definitions change. - Prepare Git commit-detail diffs and sub-line changes on worker threads with cancellation and stale-request protection. Release raw patch memory before UI construction and add regression coverage for prepared and cancelled diffs. - Add Diff Changed support and enable collapsible file headers for Diff HEAD, Diff Staged, and Diff Changes. - Update translations, compatibility call sites, tests, and the efsw dependency.
This commit is contained in:
@@ -188,6 +188,7 @@ class GitPlugin : public PluginBase {
|
||||
Git::Commit commit;
|
||||
std::string repo;
|
||||
std::atomic<Uint64> generation{ 0 };
|
||||
std::shared_ptr<std::atomic_bool> diffPreparationCancelled;
|
||||
EventConnection closeConnection;
|
||||
Tools::UIDiffView::ViewMode viewMode{ Tools::UIDiffView::ViewMode::Unified };
|
||||
bool messageExpanded{ false };
|
||||
@@ -199,7 +200,14 @@ class GitPlugin : public PluginBase {
|
||||
|
||||
void loadCommitFiles( GitPlugin& plugin, bool detached );
|
||||
|
||||
void cancelDiffPreparation() {
|
||||
if ( diffPreparationCancelled )
|
||||
diffPreparationCancelled->store( true, std::memory_order_relaxed );
|
||||
diffPreparationCancelled.reset();
|
||||
}
|
||||
|
||||
void reset() {
|
||||
cancelDiffPreparation();
|
||||
++generation;
|
||||
view = nullptr;
|
||||
subject = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user