diff options
author | XhmikosR <xhmikosr@gmail.com> | 2016-01-26 21:30:28 +0200 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2016-01-26 21:30:28 +0200 |
commit | b46520698a0913e1d97148398b0b99ea0491ef6d (patch) | |
tree | 4ddaf35c990c567751f2734b433c2cba443ce28f /scintilla/src/EditView.cxx | |
parent | c8b14b4821a3197d26b6bd2d65b0fca490bc1d09 (diff) | |
download | notepad2-mod-b46520698a0913e1d97148398b0b99ea0491ef6d.zip notepad2-mod-b46520698a0913e1d97148398b0b99ea0491ef6d.tar.gz notepad2-mod-b46520698a0913e1d97148398b0b99ea0491ef6d.tar.bz2 |
Update Scintilla to v3.6.3 HG (25eaad4).4.2.25.970
Diffstat (limited to 'scintilla/src/EditView.cxx')
-rw-r--r-- | scintilla/src/EditView.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/scintilla/src/EditView.cxx b/scintilla/src/EditView.cxx index 04b94a8..fc98c3d 100644 --- a/scintilla/src/EditView.cxx +++ b/scintilla/src/EditView.cxx @@ -376,14 +376,14 @@ void EditView::LayoutLine(const EditModel &model, int line, Surface *surface, co // See if chars, styles, indicators, are all the same bool allSame = true; // Check base line layout - char styleByte = 0; + int styleByte = 0; int numCharsInLine = 0; while (numCharsInLine < lineLength) { int charInDoc = numCharsInLine + posLineStart; char chDoc = model.pdoc->CharAt(charInDoc); - styleByte = model.pdoc->StyleAt(charInDoc); + styleByte = model.pdoc->StyleIndexAt(charInDoc); allSame = allSame && - (ll->styles[numCharsInLine] == static_cast<unsigned char>(styleByte)); + (ll->styles[numCharsInLine] == styleByte); if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseMixed) allSame = allSame && (ll->chars[numCharsInLine] == chDoc); @@ -394,7 +394,7 @@ void EditView::LayoutLine(const EditModel &model, int line, Surface *surface, co allSame = allSame && (ll->chars[numCharsInLine] == static_cast<char>(toupper(chDoc))); else { // Style::caseCamel - if ((model.pdoc->WordCharClass(ll->chars[numCharsInLine]) == CharClassify::ccWord) && + if ((model.pdoc->WordCharClass(ll->chars[numCharsInLine]) == CharClassify::ccWord) && ((numCharsInLine == 0) || (model.pdoc->WordCharClass(ll->chars[numCharsInLine - 1]) != CharClassify::ccWord))) { allSame = allSame && (ll->chars[numCharsInLine] == static_cast<char>(toupper(chDoc))); } else { @@ -444,13 +444,13 @@ void EditView::LayoutLine(const EditModel &model, int line, Surface *surface, co else if (vstyle.styles[ll->styles[charInLine]].caseForce == Style::caseLower) ll->chars[charInLine] = static_cast<char>(tolower(chDoc)); else if (vstyle.styles[ll->styles[charInLine]].caseForce == Style::caseCamel) { - if ((model.pdoc->WordCharClass(ll->chars[charInLine]) == CharClassify::ccWord) && + if ((model.pdoc->WordCharClass(ll->chars[charInLine]) == CharClassify::ccWord) && ((charInLine == 0) || (model.pdoc->WordCharClass(ll->chars[charInLine - 1]) != CharClassify::ccWord))) { ll->chars[charInLine] = static_cast<char>(toupper(chDoc)); } else { ll->chars[charInLine] = static_cast<char>(tolower(chDoc)); } - } + } } } ll->xHighlightGuide = 0; @@ -986,11 +986,10 @@ static void DrawIndicators(Surface *surface, const EditModel &model, const ViewS startPos = deco->rs.EndRun(startPos); } while ((startPos < posLineEnd) && (deco->rs.ValueAt(startPos))) { - int endPos = deco->rs.EndRun(startPos); - if (endPos > posLineEnd) - endPos = posLineEnd; + const Range rangeRun(deco->rs.StartRun(startPos), deco->rs.EndRun(startPos)); + const int endPos = std::min(rangeRun.end, posLineEnd); const bool hover = vsDraw.indicators[deco->indicator].IsDynamic() && - ((hoverIndicatorPos >= startPos) && (hoverIndicatorPos <= endPos)); + rangeRun.ContainsCharacter(hoverIndicatorPos); const int value = deco->rs.ValueAt(startPos); Indicator::DrawState drawState = hover ? Indicator::drawHover : Indicator::drawNormal; DrawIndicator(deco->indicator, startPos - posLineStart, endPos - posLineStart, @@ -1476,7 +1475,7 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi if (indicatorValue) { const Indicator &indicator = vsDraw.indicators[deco->indicator]; const bool hover = indicator.IsDynamic() && - ((model.hoverIndicatorPos >= ts.start + posLineStart) && + ((model.hoverIndicatorPos >= ts.start + posLineStart) && (model.hoverIndicatorPos <= ts.end() + posLineStart)); if (hover) { if (indicator.sacHover.style == INDIC_TEXTFORE) { |