From 2a234305f331b38199c7d61798e06a9ab050aa3d Mon Sep 17 00:00:00 2001 From: Laury Date: Mon, 27 Jun 2022 13:00:30 +0200 Subject: [PATCH] [reader] FIxed "syntax error" with colors when going backward --- apps/reader/word_wrap_view.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/reader/word_wrap_view.cpp b/apps/reader/word_wrap_view.cpp index c13400e21..b02c4ed03 100644 --- a/apps/reader/word_wrap_view.cpp +++ b/apps/reader/word_wrap_view.cpp @@ -706,7 +706,11 @@ bool WordWrapTextView::updateTextColorForward(const char * colorStart) const { bool WordWrapTextView::updateTextColorBackward(const char * colorStart) const { - if (*(colorStart++) != '\\') { + if (*(++colorStart) != '\\') { + if (*(colorStart + 1) == '%' || *(colorStart + 2) == '%') { + m_textColor = Palette::PrimaryText; + return true; + } return false; }