From 15adac519d53c477e074ecb8a6dcede758316c07 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 7 Apr 2016 11:24:25 -0700 Subject: [PATCH] Update to the new indicator API for Scintilla as 3.4 dropped the old one --- src/subs_edit_ctrl.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/subs_edit_ctrl.cpp b/src/subs_edit_ctrl.cpp index c42ae28d4..4618ea409 100644 --- a/src/subs_edit_ctrl.cpp +++ b/src/subs_edit_ctrl.cpp @@ -270,8 +270,19 @@ void SubsTextEditCtrl::UpdateStyle() { if (line_text.empty()) return; - for (auto const& style_range : agi::ass::SyntaxHighlight(line_text, tokenized_line, spellchecker.get())) - SetStyling(style_range.length, style_range.type); + SetIndicatorCurrent(0); + size_t pos = 0; + for (auto const& style_range : agi::ass::SyntaxHighlight(line_text, tokenized_line, spellchecker.get())) { + if (style_range.type == agi::ass::SyntaxStyle::SPELLING) { + SetStyling(style_range.length, agi::ass::SyntaxStyle::NORMAL); + IndicatorFillRange(pos, style_range.length); + } + else { + SetStyling(style_range.length, style_range.type); + IndicatorClearRange(pos, style_range.length); + } + pos += style_range.length; + } } void SubsTextEditCtrl::UpdateCallTip() {