mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-06-04 20:46:29 +03:00
Invalidate draw when editor updates its highlight.
Minor improvement on breadcrumb draw invalidation.
This commit is contained in:
@@ -2006,7 +2006,7 @@ void LSPClientPlugin::updateCurrentSymbol( TextDocument& doc ) {
|
||||
if ( prevSymbols == mDocCurrentSymbols.end() || prevSymbols->second != symbolsInfo ) {
|
||||
mDocCurrentSymbols[uri] = std::move( symbolsInfo );
|
||||
getManager()->getSplitter()->forEachEditor( [&uri]( UICodeEditor* editor ) {
|
||||
if ( editor->getDocument().getURI() == uri )
|
||||
if ( editor->isVisible() && editor->getDocument().getURI() == uri )
|
||||
editor->invalidateDraw();
|
||||
} );
|
||||
}
|
||||
@@ -2054,7 +2054,7 @@ void LSPClientPlugin::showDocumentSymbols( UICodeEditor* editor ) {
|
||||
std::vector<std::string> path;
|
||||
for ( const auto& sym : docSymbols )
|
||||
path.emplace_back( sym.name );
|
||||
tv->selectRowWithPath( String::join( path, '/' ) );
|
||||
tv->selectRowWithPath( path );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -321,7 +321,8 @@ void LSPDocumentClient::highlight() {
|
||||
}
|
||||
Clock clock;
|
||||
const auto& caps = mServer->getCapabilities().semanticTokenProvider;
|
||||
Uint32 currentLine = 0;
|
||||
Int64 firstLine = !data.empty() ? data[0] : -1;
|
||||
Int64 currentLine = 0;
|
||||
Uint32 start = 0;
|
||||
std::unordered_map<size_t, TokenizedLine> tokenizerLines;
|
||||
Int64 lastLine = 0;
|
||||
@@ -372,6 +373,16 @@ void LSPDocumentClient::highlight() {
|
||||
mDoc->getHighlighter()->mergeLine( tline.first, tline.second );
|
||||
}
|
||||
|
||||
if ( firstLine != -1 && lastLine >= firstLine && mDoc ) {
|
||||
getServer()->getManager()->getPlugin()->getManager()->getSplitter()->forEachEditor(
|
||||
[this, firstLine, lastLine]( UICodeEditor* editor ) {
|
||||
if ( editor->isVisible() && &editor->getDocument() == mDoc &&
|
||||
editor->getVisibleRange().intersectsLineRange( firstLine, lastLine ) ) {
|
||||
editor->invalidateDraw();
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
if ( !mServer->isSilent() ) {
|
||||
Log::debug(
|
||||
"LSPDocumentClient::highlight took: %.2f ms. Diff analysis took: %.2f ms. Updated "
|
||||
|
||||
Reference in New Issue
Block a user