Menu

#2051 SCI_MARKERADD returns 0 rather than -1

Bug
closed-fixed
scintilla (610)
5
2019-01-11
2018-10-16
No

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;
    }
}

Discussion

  • Neil Hodgson

    Neil Hodgson - 2018-10-16
    • labels: --> scintilla
    • status: open --> open-fixed
    • assigned_to: Neil Hodgson
     
  • Neil Hodgson

    Neil Hodgson - 2018-10-16

    Fixed with [0cbbfa].

     

    Related

    Commit: [0cbbfa]

  • Neil Hodgson

    Neil Hodgson - 2019-01-11
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB