mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-31 02:26:29 +03:00
Crash fix and optimization.
This commit is contained in:
@@ -13,6 +13,8 @@ static std::vector<TextRange> findFoldingRangesBraces( TextDocument* doc ) {
|
||||
std::vector<TextRange> regions;
|
||||
const auto& braces = doc->getSyntaxDefinition().getFoldBraces();
|
||||
size_t linesCount = doc->linesCount();
|
||||
if ( linesCount <= 2 )
|
||||
return regions;
|
||||
auto highlighter = doc->getHighlighter();
|
||||
for ( size_t lineIdx = 0; lineIdx < linesCount; lineIdx++ ) {
|
||||
const auto& line = doc->line( lineIdx ).getText();
|
||||
|
||||
@@ -1502,9 +1502,9 @@ TextPosition currentMouseTextPosition( UICodeEditor* editor ) {
|
||||
}
|
||||
|
||||
void LSPClientPlugin::tryHideTooltip( UICodeEditor* editor, const Vector2i& position ) {
|
||||
TextPosition cursorPosition = editor->resolveScreenPosition( position.asFloat() );
|
||||
if ( !mCurrentHover.range.isValid() ||
|
||||
( mCurrentHover.range.isValid() && !mCurrentHover.range.contains( cursorPosition ) ) )
|
||||
( mCurrentHover.range.isValid() &&
|
||||
!mCurrentHover.range.contains( editor->resolveScreenPosition( position.asFloat() ) ) ) )
|
||||
hideTooltip( editor );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user