MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / SetTextLines

Method SetTextLines

plugins/Cardinal/src/DearImGuiColorTextEditor/TextEditor.cpp:1187–1216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1185}
1186
1187void TextEditor::SetTextLines(const std::vector<std::string> & aLines)
1188{
1189 mLines.clear();
1190
1191 if (aLines.empty())
1192 {
1193 mLines.emplace_back(Line());
1194 }
1195 else
1196 {
1197 mLines.resize(aLines.size());
1198
1199 for (size_t i = 0; i < aLines.size(); ++i)
1200 {
1201 const std::string & aLine = aLines[i];
1202
1203 mLines[i].reserve(aLine.size());
1204 for (size_t j = 0; j < aLine.size(); ++j)
1205 mLines[i].emplace_back(Glyph(aLine[j], PaletteIndex::Default));
1206 }
1207 }
1208
1209 mTextChanged = true;
1210 mScrollToTop = true;
1211
1212 mUndoBuffer.clear();
1213 mUndoIndex = 0;
1214
1215 Colorize();
1216}
1217
1218void TextEditor::EnterCharacter(ImWchar aChar, bool aShift)
1219{

Callers 1

setTextLinesMethod · 0.80

Calls 7

GlyphClass · 0.85
emplace_backMethod · 0.80
clearMethod · 0.45
emptyMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected