mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-11 01:01:25 +03:00
Minor improvement in the UICodeEditor minimap scrolling.
ecode: AutoCompleteModule minor optimizations.
This commit is contained in:
@@ -972,6 +972,11 @@ Uint32 UICodeEditor::onMouseDown( const Vector2i& position, const Uint32& flags
|
||||
mVScrollBar->setEnabled( false );
|
||||
return 1;
|
||||
} else if ( mMinimapDragging ) {
|
||||
if ( mMouseDown ) {
|
||||
scrollTo( { calculateMinimapClickedLine( position ) - mMinimapScrollOffset, 0 },
|
||||
false, true );
|
||||
getUISceneNode()->setCursor( Cursor::Arrow );
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ void AutoCompleteModule::updateDocCache( TextDocument* doc ) {
|
||||
Lock l( mDocMutex );
|
||||
Clock clock;
|
||||
auto docCache = mDocCache.find( doc );
|
||||
if ( docCache == mDocCache.end() )
|
||||
if ( docCache == mDocCache.end() || mClosing )
|
||||
return;
|
||||
auto& cache = docCache->second;
|
||||
cache.changeId = doc->getCurrentChangeId();
|
||||
@@ -410,7 +410,7 @@ AutoCompleteModule::SymbolsList AutoCompleteModule::getDocumentSymbols( TextDocu
|
||||
LuaPattern pattern( mSymbolPattern );
|
||||
AutoCompleteModule::SymbolsList symbols;
|
||||
Int64 lc = doc->linesCount();
|
||||
if ( lc == 0 )
|
||||
if ( lc == 0 || lc > 50000 || mClosing )
|
||||
return symbols;
|
||||
std::string current( getPartialSymbol( doc ) );
|
||||
TextPosition end = doc->getSelection().end();
|
||||
@@ -423,6 +423,8 @@ AutoCompleteModule::SymbolsList AutoCompleteModule::getDocumentSymbols( TextDocu
|
||||
continue;
|
||||
symbols.insert( std::move( matchStr ) );
|
||||
}
|
||||
if ( mClosing )
|
||||
break;
|
||||
}
|
||||
return symbols;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user