mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-10-01 18:50:16 +03:00
Fixed the autocomplete crash, root cause: getDocumentSymbols() accessed mDocs from a worker thread while document lifecycle callbacks could concurrently modify the same unordered_set, corrupting its internal state.
Added a synthetic “Working Tree / Index” first row whenever the selected repository has local or staged changes. Displays separate changed and staged counts. Updates dynamically from normal status refreshes without reloading commit history. Selecting it opens the shared details view in “Uncommitted changes” mode. Shows tracked changes from HEAD through the working tree, plus untracked-file patches. Supports both sidebar and detached History views. The History shortcut focuses working changes when present, otherwise the newest commit. Added the History button beside Refresh. Added consistent 2dp spacing between the ref dropdown and both buttons. Added translations for the new labels.
This commit is contained in:
@@ -45,21 +45,29 @@ class EE_API UIDiffView : public UIWidget, public WidgetCommandExecuter {
|
||||
virtual ~UIDiffView();
|
||||
|
||||
virtual Uint32 getType() const override;
|
||||
|
||||
virtual bool isType( const Uint32& type ) const override;
|
||||
|
||||
void loadFromPatch( const std::string& patchText, const std::string& originalFilePath = "",
|
||||
const std::string& oldFilePath = "", const std::string& repoPath = "" );
|
||||
|
||||
void loadFromStrings( const std::string& oldText, const std::string& newText,
|
||||
const std::string& originalFilePath = "" );
|
||||
|
||||
void loadFromFile( const std::string& oldFilePath, const std::string& newFilePath );
|
||||
|
||||
UICodeEditor* getEditor() const { return mEditor; }
|
||||
|
||||
UICodeEditor* getLeftEditor() const { return mLeftEditor; }
|
||||
|
||||
UICodeEditor* getRightEditor() const { return mRightEditor; }
|
||||
|
||||
UIImageViewer* getLeftImageViewer() const { return mLeftImageViewer; }
|
||||
|
||||
UIImageViewer* getRightImageViewer() const { return mRightImageViewer; }
|
||||
|
||||
enum class DiffLineType { Common, Added, Removed, Header };
|
||||
|
||||
struct DiffLine {
|
||||
DiffLineType type{ DiffLineType::Common };
|
||||
String text;
|
||||
@@ -69,27 +77,37 @@ class EE_API UIDiffView : public UIWidget, public WidgetCommandExecuter {
|
||||
};
|
||||
|
||||
const std::vector<DiffLine>& getDiffLines() const { return mLines; }
|
||||
|
||||
const std::vector<size_t>& getViewLines() const { return mViewLines; }
|
||||
|
||||
void setViewMode( ViewMode mode );
|
||||
|
||||
ViewMode getViewMode() const { return mViewMode; }
|
||||
|
||||
void setViewModeToggleVisible( bool visible );
|
||||
|
||||
bool isViewModeToggleVisible() const { return mViewModeToggleVisible; }
|
||||
|
||||
void setCompleteView( bool complete );
|
||||
|
||||
bool isCompleteView() const { return mShowCompleteView; }
|
||||
|
||||
void setCompleteViewToggleVisible( bool visible );
|
||||
|
||||
bool isCompleteViewToggleVisible() const { return mCompleteViewToggleVisible; }
|
||||
|
||||
void setSubLineDiffAlgorithm( SubLineDiffAlgorithm algo );
|
||||
|
||||
SubLineDiffAlgorithm getSubLineDiffAlgorithm() const { return mSubLineDiffAlgorithm; }
|
||||
|
||||
void setSyntaxColorScheme( const SyntaxColorScheme& colorScheme );
|
||||
|
||||
void setHeadersVisible( bool visible );
|
||||
|
||||
void setInteractiveFileHeader( bool enabled );
|
||||
|
||||
bool isInteractiveFileHeader() const { return mInteractiveFileHeader; }
|
||||
|
||||
void setCollapsed( bool collapsed );
|
||||
bool isCollapsed() const { return mCollapsed; }
|
||||
|
||||
@@ -97,6 +115,14 @@ class EE_API UIDiffView : public UIWidget, public WidgetCommandExecuter {
|
||||
|
||||
const String& getFileName() const { return mFileName; }
|
||||
|
||||
const String& getFileDisplayName() const { return mFileDisplayName; }
|
||||
|
||||
const String& getFileDisplayPath() const { return mFileDisplayPath; }
|
||||
|
||||
const String& getAddedLinesText() const { return mAddedLinesText; }
|
||||
|
||||
const String& getRemovedLinesText() const { return mRemovedLinesText; }
|
||||
|
||||
bool isImageDiff() const { return mIsImageDiff; }
|
||||
|
||||
void setAutoDeleteOldTempImage( bool set ) { mAutoDeleteOldTempImage = set; }
|
||||
@@ -125,8 +151,13 @@ class EE_API UIDiffView : public UIWidget, public WidgetCommandExecuter {
|
||||
bool mIsImageDiff{ false };
|
||||
bool mAutoDeleteOldTempImage{ false };
|
||||
bool mCollapsed{ false };
|
||||
bool mInteractiveFileHeader{ false };
|
||||
std::shared_ptr<SyntaxDefinition> mSyntaxDef;
|
||||
String mFileName;
|
||||
String mFileDisplayName;
|
||||
String mFileDisplayPath;
|
||||
String mAddedLinesText;
|
||||
String mRemovedLinesText;
|
||||
std::string mImageDiffOldPath;
|
||||
std::string mImageDiffNewPath;
|
||||
|
||||
@@ -141,18 +172,32 @@ class EE_API UIDiffView : public UIWidget, public WidgetCommandExecuter {
|
||||
virtual Uint32 onKeyDown( const KeyEvent& event ) override;
|
||||
|
||||
void createEditor( UICodeEditor*& editor, std::unique_ptr<UIDiffEditorPlugin>& plugin );
|
||||
|
||||
void syncScroll( UICodeEditor* source, UICodeEditor* target, bool emitEvent = false );
|
||||
|
||||
void updateModeButton();
|
||||
|
||||
void computeSubLineDiff( DiffLine& oldLine, DiffLine& newLine );
|
||||
|
||||
void updateEditorsText();
|
||||
|
||||
void updateButtonsText();
|
||||
|
||||
void updateButtonsVisibility();
|
||||
|
||||
void createImageViewers();
|
||||
|
||||
bool loadImageDiffFromPaths( const std::string& oldFilePath, const std::string& newFilePath );
|
||||
|
||||
void updateImageDiffView();
|
||||
|
||||
void resetToTextDiffView();
|
||||
|
||||
void imageDisplayState( bool& displayDiffImage, bool& displayLeftImage );
|
||||
|
||||
void updateImagesPosAndSize();
|
||||
|
||||
void updateFileHeaderInfo();
|
||||
};
|
||||
|
||||
} // namespace Tools
|
||||
|
||||
Reference in New Issue
Block a user