SCI_MARKERADD returns 0 rather than -1 as the documentation says.
SCI_MARKERADD(int line, int markerNumber) → int
This message adds marker number markerNumber to a line. The message returns -1 if this fails (illegal line number, out of memory) or it returns a marker handle number that identifies the added marker.
The problem seems to be here (else part):
int Document::AddMark(Sci::Line line, int markerNum) {
if (line >= 0 && line <= LinesTotal()) {
const int prev = Markers()->AddMark(line, markerNum, LinesTotal());
const DocModification mh(SC_MOD_CHANGEMARKER, LineStart(line), 0, 0, nullptr, line);
NotifyModified(mh);
return prev;
} else {
return 0;
}
}
Fixed with [0cbbfa].
Related
Commit: [0cbbfa]