From ea41c6842b4d73aa73041b3d21ecf02ceeecfb8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Thu, 25 Sep 2025 13:59:26 -0300 Subject: [PATCH] Fix line endings fallback. --- src/eepp/ui/uicodeeditor.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/eepp/ui/uicodeeditor.cpp b/src/eepp/ui/uicodeeditor.cpp index cc53b4b8a..8639d37bb 100644 --- a/src/eepp/ui/uicodeeditor.cpp +++ b/src/eepp/ui/uicodeeditor.cpp @@ -647,9 +647,7 @@ void UICodeEditor::onFontStyleChanged() { void UICodeEditor::onDocumentLoaded( TextDocument* ) { if ( mInvalidateOnLoaded ) { - ensureMainThread( [this] { - onDocumentLoaded(); - } ); + ensureMainThread( [this] { onDocumentLoaded(); } ); mInvalidateOnLoaded = false; } } @@ -4390,9 +4388,10 @@ void UICodeEditor::drawLineEndings( const DocumentLineRange& lineRange, const Ve const Float& /*lineHeight*/ ) { Color color( Color( mWhitespaceColor ).blendAlpha( mAlpha ) ); auto fontSize = getCharacterSize(); - GlyphDrawable* nl = mFont->getGlyphDrawable( 8628 /*'↴'*/, fontSize ); - if ( nl->getPixelsSize() == Sizef::Zero ) - nl = mFont->getGlyphDrawable( 172 /* '¬'*/, fontSize ); + bool hasMainGlyph = mFont && mFont->getType() == FontType::TTF && + static_cast( mFont )->hasGlyph( 8628 ); + GlyphDrawable* nl = + mFont->getGlyphDrawable( hasMainGlyph ? 0x21B5 /*'↵'*/ : 172 /* '¬'*/, fontSize ); nl->setDrawMode( GlyphDrawable::DrawMode::Text ); nl->setColor( color ); for ( auto index = lineRange.first; index <= lineRange.second; index++ ) {