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

Method SetStyles

scintilla/src/Document.cxx:1694–1720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1692}
1693
1694bool SCI_METHOD Document::SetStyles(int length, const char *styles) {
1695 if (enteredStyling != 0) {
1696 return false;
1697 } else {
1698 enteredStyling++;
1699 bool didChange = false;
1700 int startMod = 0;
1701 int endMod = 0;
1702 for (int iPos = 0; iPos < length; iPos++, endStyled++) {
1703 PLATFORM_ASSERT(endStyled < Length());
1704 if (cb.SetStyleAt(endStyled, styles[iPos], stylingMask)) {
1705 if (!didChange) {
1706 startMod = endStyled;
1707 }
1708 didChange = true;
1709 endMod = endStyled;
1710 }
1711 }
1712 if (didChange) {
1713 DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER,
1714 startMod, endMod - startMod + 1);
1715 NotifyModified(mh);
1716 }
1717 enteredStyling--;
1718 return true;
1719 }
1720}
1721
1722void Document::EnsureStyledTo(int pos) {
1723 if ((enteredStyling == 0) && (pos > GetEndStyled())) {

Callers 2

MarginSetStylesMethod · 0.45
AnnotationSetStylesMethod · 0.45

Calls 1

SetStyleAtMethod · 0.80

Tested by

no test coverage detected