MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / writeErrorToOutput

Method writeErrorToOutput

src/docks/LuaConsoleDock.cpp:235–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235void LuaConsoleDock::writeErrorToOutput(const char *s)
236{
237 typedef struct {
238 unsigned char c;
239 unsigned char style;
240 } cell;
241
242 const int length = static_cast<int>(strlen(s));
243 QVector<cell> cells(length + 1);
244
245 for (auto i = 0; i < length; ++i) {
246 cells[i].c = s[i];
247 cells[i].style = 39;
248 }
249
250 cells[length].c = 0;
251 cells[length].style = 0;
252
253 output->setReadOnly(false);
254 output->documentEnd();
255 output->addStyledText(length * 2, (const char *) cells.constData());
256 output->setReadOnly(true);
257 output->documentEnd();
258}
259
260void LuaConsoleDock::historyNext()
261{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected