MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / SetBracesHighlight

Method SetBracesHighlight

scintilla/src/PositionCache.cxx:154–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154void LineLayout::SetBracesHighlight(Range rangeLine, Position braces[],
155 char bracesMatchStyle, int xHighlight, bool ignoreStyle) {
156 if (!ignoreStyle && rangeLine.ContainsCharacter(braces[0])) {
157 int braceOffset = braces[0] - rangeLine.start;
158 if (braceOffset < numCharsInLine) {
159 bracePreviousStyles[0] = styles[braceOffset];
160 styles[braceOffset] = bracesMatchStyle;
161 }
162 }
163 if (!ignoreStyle && rangeLine.ContainsCharacter(braces[1])) {
164 int braceOffset = braces[1] - rangeLine.start;
165 if (braceOffset < numCharsInLine) {
166 bracePreviousStyles[1] = styles[braceOffset];
167 styles[braceOffset] = bracesMatchStyle;
168 }
169 }
170 if ((braces[0] >= rangeLine.start && braces[1] <= rangeLine.end) ||
171 (braces[1] >= rangeLine.start && braces[0] <= rangeLine.end)) {
172 xHighlightGuide = xHighlight;
173 }
174}
175
176void LineLayout::RestoreBracesHighlight(Range rangeLine, Position braces[], bool ignoreStyle) {
177 if (!ignoreStyle && rangeLine.ContainsCharacter(braces[0])) {

Callers 1

PaintMethod · 0.80

Calls 1

ContainsCharacterMethod · 0.45

Tested by

no test coverage detected