From 8f5b9fb51997c62ef13bf0848c6c213e8a100863 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Fri, 28 Aug 2020 09:58:48 -0700 Subject: Fix for T75369: Text Editor Line Color Use correct text color when syntax highlighting is off but line numbers are on. Differential Revision: https://developer.blender.org/D7337 Reviewed by Hans Goudey --- source/blender/editors/space_text/text_draw.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'source/blender/editors/space_text/text_draw.c') diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index f1b1d6760f3..ec5175eae51 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1660,25 +1660,16 @@ void draw_text_main(SpaceText *st, ARegion *region) } if (st->showlinenrs && !wrap_skip) { - /* draw line number */ - if (tmp == text->curl) { - UI_FontThemeColor(tdc.font_id, TH_HILITE); - } - else { - UI_FontThemeColor(tdc.font_id, TH_LINENUMBERS); - } - + /* Draw line number. */ + UI_FontThemeColor(tdc.font_id, (tmp == text->curl) ? TH_HILITE : TH_LINENUMBERS); BLI_snprintf(linenr, sizeof(linenr), "%*d", st->runtime.line_number_display_digits, i + linecount + 1); - /* itoa(i + linecount + 1, linenr, 10); */ /* not ansi-c :/ */ text_font_draw(&tdc, TXT_NUMCOL_PAD * st->runtime.cwidth_px, y, linenr); - - if (tmp == text->curl) { - UI_FontThemeColor(tdc.font_id, TH_TEXT); - } + /* Change back to text color. */ + UI_FontThemeColor(tdc.font_id, TH_TEXT); } if (st->wordwrap) { -- cgit v1.2.3