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

Method AddStyledText

scintilla/src/Editor.cxx:7410–7426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7408}
7409
7410void Editor::AddStyledText ( char *buffer, int appendLength )
7411{
7412 // The buffer consists of alternating character bytes and style bytes
7413 int textLength = appendLength / 2;
7414 std::string text ( textLength, '\0' );
7415 int i;
7416 for ( i = 0; i < textLength; i++ ) {
7417 text[i] = buffer[i * 2];
7418 }
7419 pdoc->InsertString ( CurrentPosition(), text.c_str(), textLength );
7420 for ( i = 0; i < textLength; i++ ) {
7421 text[i] = buffer[i * 2 + 1];
7422 }
7423 pdoc->StartStyling ( CurrentPosition(), static_cast<char> ( 0xff ) );
7424 pdoc->SetStyles ( textLength, text.c_str() );
7425 SetEmptySelection ( sel.MainCaret() + textLength );
7426}
7427
7428static bool ValidMargin ( unsigned long wParam )
7429{

Callers

nothing calls this directly

Calls 4

StartStylingMethod · 0.80
MainCaretMethod · 0.80
InsertStringMethod · 0.45
SetStylesMethod · 0.45

Tested by

no test coverage detected