mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-31 10:36:30 +03:00
Fix automatic scrolling while writing in UITextEdit.
Fix threadpool close. Git plugin safetly destruct.
This commit is contained in:
@@ -701,7 +701,7 @@ class EE_API UICodeEditor : public UIWidget, public TextDocument::Client {
|
||||
SyntaxColorScheme mColorScheme;
|
||||
UIScrollBar* mVScrollBar;
|
||||
UIScrollBar* mHScrollBar;
|
||||
std::unordered_map<size_t, LastXOffset> mLastXOffset;
|
||||
UnorderedMap<size_t, LastXOffset> mLastXOffset;
|
||||
KeyBindings mKeyBindings;
|
||||
std::unordered_set<std::string> mUnlockedCmd;
|
||||
Clock mLastDoubleClick;
|
||||
@@ -728,7 +728,8 @@ class EE_API UICodeEditor : public UIWidget, public TextDocument::Client {
|
||||
Text text;
|
||||
String::HashType hash;
|
||||
};
|
||||
mutable std::unordered_map<Int64, TextLine> mTextCache;
|
||||
mutable UnorderedMap<Int64, TextLine> mTextCache;
|
||||
UnorderedMap<Int64, std::pair<String::HashType, Float>> mLinesWidthCache;
|
||||
Tools::UIDocFindReplace* mFindReplace{ nullptr };
|
||||
struct PluginRequestedSpace {
|
||||
UICodeEditorPlugin* plugin;
|
||||
|
||||
@@ -941,11 +941,10 @@ void UICodeEditor::updateIMELocation() {
|
||||
}
|
||||
|
||||
void UICodeEditor::drawLockedIcon( const Vector2f start ) {
|
||||
if ( mFileLockIcon == nullptr && !mFileLockIconName.empty() ) {
|
||||
if ( mFileLockIcon == nullptr && !mFileLockIconName.empty() )
|
||||
mFileLockIcon = getUISceneNode()->findIcon( mFileLockIconName );
|
||||
if ( mFileLockIcon == nullptr )
|
||||
return;
|
||||
}
|
||||
if ( mFileLockIcon == nullptr )
|
||||
return;
|
||||
|
||||
Drawable* fileLockIcon = mFileLockIcon->getSize( PixelDensity::dpToPxI( 16 ) );
|
||||
if ( fileLockIcon == nullptr )
|
||||
@@ -1552,19 +1551,23 @@ void UICodeEditor::findLongestLine() {
|
||||
Float UICodeEditor::getLineWidth( const Int64& lineIndex ) {
|
||||
if ( lineIndex >= (Int64)mDoc->linesCount() )
|
||||
return 0;
|
||||
if ( mFont && !mFont->isMonospace() )
|
||||
return Text::getTextWidth( mFont, getCharacterSize(), mDoc->line( lineIndex ).getText(),
|
||||
mFontStyleConfig.Style, mTabWidth ) +
|
||||
getGlyphWidth();
|
||||
if ( mFont && !mFont->isMonospace() ) {
|
||||
auto line = mDoc->line( lineIndex );
|
||||
auto found = mLinesWidthCache.find( lineIndex );
|
||||
if ( found != mLinesWidthCache.end() && line.getHash() == found->first )
|
||||
return found->second.second;
|
||||
Float width = getTextWidth( line.getText() ) + getGlyphWidth();
|
||||
mLinesWidthCache[lineIndex] = { line.getHash(), width };
|
||||
return width;
|
||||
}
|
||||
return getTextWidth( mDoc->line( lineIndex ).getText() );
|
||||
}
|
||||
|
||||
void UICodeEditor::updateScrollBar() {
|
||||
int notVisibleLineCount = (int)mDoc->linesCount() - (int)getViewPortLineCount().y;
|
||||
|
||||
if ( mLongestLineWidthDirty && mFont && mFont->isMonospace() ) {
|
||||
if ( mLongestLineWidthDirty && mFont )
|
||||
updateLongestLineWidth();
|
||||
}
|
||||
|
||||
mHScrollBar->setEnabled( false );
|
||||
mHScrollBar->setVisible( false );
|
||||
|
||||
@@ -714,7 +714,10 @@ App::App( const size_t& jobs, const std::vector<std::string>& args ) :
|
||||
App::~App() {
|
||||
if ( mProjectBuildManager )
|
||||
mProjectBuildManager.reset();
|
||||
|
||||
Http::setThreadPool( nullptr );
|
||||
mThreadPool.reset();
|
||||
|
||||
if ( mFileWatcher ) {
|
||||
Lock l( mWatchesLock );
|
||||
delete mFileWatcher;
|
||||
|
||||
@@ -81,6 +81,11 @@ GitPlugin::~GitPlugin() {
|
||||
mStatusButton->close();
|
||||
if ( mSidePanel && mTab )
|
||||
mSidePanel->removeTab( mTab );
|
||||
|
||||
{ Lock l( mGitBranchMutex ); }
|
||||
{ Lock l( mGitStatusMutex ); }
|
||||
{ Lock l( mRepoMutex ); }
|
||||
{ Lock l( mReposMutex ); }
|
||||
}
|
||||
|
||||
void GitPlugin::load( PluginManager* pluginManager ) {
|
||||
|
||||
Reference in New Issue
Block a user