| 4678 | } |
| 4679 | |
| 4680 | void UICodeEditor::drawLineEndings( const DocumentLineRange& lineRange, const Vector2f& startScroll, |
| 4681 | const Float& /*lineHeight*/ ) { |
| 4682 | Color color( Color( mWhitespaceColor ).blendAlpha( mAlpha ) ); |
| 4683 | auto fontSize = getCharacterSize(); |
| 4684 | bool hasMainGlyph = mFont && mFont->getType() == FontType::TTF && |
| 4685 | static_cast<FontTrueType*>( mFont )->hasGlyph( 0x23CE ); // ⏎ |
| 4686 | bool hasSecondaryGlyph = !hasMainGlyph && mFont && mFont->getType() == FontType::TTF && |
| 4687 | static_cast<FontTrueType*>( mFont )->hasGlyph( 0x21B5 ); // ↵ |
| 4688 | GlyphDrawable* nl = mFont->getGlyphDrawable( |
| 4689 | hasMainGlyph ? 0x23CE : ( hasSecondaryGlyph ? 0x21B5 /*'↵'*/ : 172 /* '¬'*/ ), fontSize ); |
| 4690 | nl->setDrawMode( GlyphDrawable::DrawMode::Text ); |
| 4691 | nl->setColor( color ); |
| 4692 | for ( auto index = lineRange.first; index <= lineRange.second; index++ ) { |
| 4693 | if ( !mDocView.isLineVisible( index ) ) |
| 4694 | continue; |
| 4695 | auto offset = |
| 4696 | getTextPositionOffset( { index, static_cast<Int64>( mDoc->line( index ).size() ) } ); |
| 4697 | Vector2f position( { static_cast<Float>( startScroll.x + offset.x ), |
| 4698 | static_cast<Float>( startScroll.y + offset.y ) } ); |
| 4699 | nl->draw( Vector2f( position.x, position.y ) ); |
| 4700 | } |
| 4701 | } |
| 4702 | |
| 4703 | void UICodeEditor::registerCommands() { |
| 4704 | mDoc->setCommand( "move-to-previous-line", [this] { moveToPreviousLine(); } ); |
nothing calls this directly
no test coverage detected