Exemplo n.º 1
0
int EBuffer::LineNew() {
    if (SplitLine(VToR(CP.Row), CP.Col) == 0)
        return 0;

    if (!MoveDown())
        return 0;

    if (CP.Col > 0) {

        if (!MoveLineStart())
            return 0;

        //int Indent = LineIndented(VToR(CP.Row));

        if (!LineIndent())
            return 0;

        //if (Indent > 0)
        //  if (InsText(Row, C, Indent, 0) == 0)
        //    return 0;

        if (BFI(this, BFI_Trim))
            if (TrimLine(VToR(CP.Row - 1)) == 0)
                return 0;
    }
    return 1;
}
Exemplo n.º 2
0
int EBuffer::BlockReIndent() {
    EPoint P = CP;
    EPoint B, E;

    AutoExtend = 0;
    if (CheckBlock() == 0) return 0;
    if (RCount <= 0) return 0;
    B = BB;
    E = BE;
    Draw(B.Row, E.Row);
    for (int i = B.Row; i < E.Row; i++) {
        if (SetPosR(0, i) == 0) return 0;
        if (LineIndent() == 0) return 0;
    }
    return SetPos(P.Col, P.Row);
}
Exemplo n.º 3
0
int EBuffer::IndentFunction() {
    EPoint P = CP;
    int by, ey;

    if ((by = FindFunction( 0, -1)) == -1)
        return 0;
    if ((ey = FindFunction(+1, +1)) == -1)
        return 0;

    //Draw(by, ey); ?
    for (int i = by; i < ey; i++) {
        if (SetPosR(0, i) == 0)
            return 0;
        if (LineIndent() == 0)
            return 0;
    }
    return SetPos(P.Col, P.Row);
}