From 9b8b0bc98f6f1e80d6d63017a2e11b03cd1108bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Wed, 11 Mar 2020 11:56:14 +0100 Subject: [PATCH] [apps/code] PythonTextArea should always be the PythonUser when coloring --- apps/code/python_text_area.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/apps/code/python_text_area.cpp b/apps/code/python_text_area.cpp index b1a243af1..e924a03d2 100644 --- a/apps/code/python_text_area.cpp +++ b/apps/code/python_text_area.cpp @@ -75,23 +75,7 @@ void PythonTextArea::ContentView::clearRect(KDContext * ctx, KDRect rect) const void PythonTextArea::ContentView::drawLine(KDContext * ctx, int line, const char * text, size_t byteLength, int fromColumn, int toColumn, const char * selectionStart, const char * selectionEnd) const { LOG_DRAW("Drawing \"%.*s\"\n", byteLength, text); - if (!m_pythonDelegate->isPythonUser(this)) { - const char * lineStart = UTF8Helper::CodePointAtGlyphOffset(text, fromColumn); - const char * lineEnd = UTF8Helper::CodePointAtGlyphOffset(text, toColumn); - drawStringAt( - ctx, - line, - fromColumn, - lineStart, - std::min(text + byteLength, lineEnd) - lineStart, - StringColor, - BackgroundColor, - selectionStart, - selectionEnd, - HighlightColor - ); - return; - } + assert(m_pythonDelegate->isPythonUser(this)); /* We're using the MicroPython lexer to do syntax highlighting on a per-line * basis. This can work, however the MicroPython lexer won't accept a line