From d378c39d5a6c7a5b216a69d165038b8e541fc5c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Fri, 13 Oct 2023 22:20:37 -0300 Subject: [PATCH] Minor fixes. --- src/eepp/ui/uicodeeditor.cpp | 1 + src/eepp/ui/uiconsole.cpp | 6 +++--- src/tools/ecode/plugins/lsp/lspdocumentclient.cpp | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/eepp/ui/uicodeeditor.cpp b/src/eepp/ui/uicodeeditor.cpp index 9e6a2b90f..128c1525b 100644 --- a/src/eepp/ui/uicodeeditor.cpp +++ b/src/eepp/ui/uicodeeditor.cpp @@ -568,6 +568,7 @@ void UICodeEditor::onDocumentLoaded( TextDocument* ) {} void UICodeEditor::onDocumentLoaded() { DocEvent event( this, mDoc.get(), Event::OnDocumentLoaded ); sendEvent( &event ); + invalidateDraw(); } void UICodeEditor::onDocumentChanged() { diff --git a/src/eepp/ui/uiconsole.cpp b/src/eepp/ui/uiconsole.cpp index c5421e00b..00e0510bc 100644 --- a/src/eepp/ui/uiconsole.cpp +++ b/src/eepp/ui/uiconsole.cpp @@ -429,7 +429,7 @@ void UIConsole::draw() { .blendAlpha( (Uint8)mAlpha ) ); Primitives p; - p.setColor( mFontStyleConfig.FontSelectionBackColor.blendAlpha( (Uint8)mAlpha ) ); + p.setColor( Color( mFontStyleConfig.FontSelectionBackColor ).blendAlpha( (Uint8)mAlpha ) ); auto to = eemax( mCon.min - mCon.modif, 0 ); auto from = eemin( mCon.max - mCon.modif, (int)mCmdLog.size() - 1 ); @@ -997,9 +997,9 @@ TextPosition UIConsole::getPositionOnScreen( Vector2f position ) { auto firstVisibleLine = eemax( mCon.min - mCon.modif, 0 ); Float startOffset = getPixelsSize().getHeight() - mPaddingPx.Bottom - linesInScreen * lineHeight; - Int64 line = eeclamp( (Int64)0, (Int64)eefloor( ( position.y - startOffset ) / lineHeight + 1 ), + Int64 line = eeclamp( (Int64)eefloor( ( position.y - startOffset ) / lineHeight + 1 ), (Int64)0, (Int64)mCmdLog.size() - 1 ); - Int64 fline = eeclamp( (Int64)0, firstVisibleLine + line, (Int64)mCmdLog.size() - 1 ); + Int64 fline = eeclamp( firstVisibleLine + line, (Int64)0, (Int64)mCmdLog.size() - 1 ); Int64 col = Text::findCharacterFromPos( { (int)eefloor( position.x - mPaddingPx.Left ), 0 }, true, mFontStyleConfig.Font, mFontStyleConfig.CharacterSize, mCmdLog[fline].log, mFontStyleConfig.Style ); diff --git a/src/tools/ecode/plugins/lsp/lspdocumentclient.cpp b/src/tools/ecode/plugins/lsp/lspdocumentclient.cpp index 9111b10dc..3d3b110e1 100644 --- a/src/tools/ecode/plugins/lsp/lspdocumentclient.cpp +++ b/src/tools/ecode/plugins/lsp/lspdocumentclient.cpp @@ -85,9 +85,10 @@ void LSPDocumentClient::onDocumentReloaded( TextDocument* ) { TextDocument* doc = mDoc; LSPClientServer* server = mServer; auto version = ++mVersion; - mServer->getThreadPool()->run( [server, doc, uri, version]() { + mServer->getThreadPool()->run( [this, server, doc, uri, version]() { server->didClose( uri ); server->didOpen( doc, version ); + requestSemanticHighlighting( true ); } ); refreshTag(); }