| 1185 | } |
| 1186 | |
| 1187 | void 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 | |
| 1218 | void TextEditor::EnterCharacter(ImWchar aChar, bool aShift) |
| 1219 | { |
no test coverage detected