sps.c
State irow_cmd(Context ctx) {
    if (ctx.argStr[0] != '\0')
        return ERR_BAD_SYNTAX;

    State s;
    s = addRow(ctx.table);

    if (s == SUCCESS) {
        // start on the last line
        unsigned start = ctx.table->rows;
        // and swap until you get to the top of selection
        unsigned end = selUpperBound(ctx.table);
        // move the empty row up to the selection
        s = moveRow(ctx.table, start, end);
    }
    return s;
}
// inserts a row right above the selected region
inserts a row right above the selected region
inserts a row right above the selected region
State irow_cmd(Context ctx) {
    if (ctx.argStr[0] != '\0')
        return ERR_BAD_SYNTAX;
    State s;
    s = addRow(ctx.table);
    if (s == SUCCESS) {
        unsigned start = ctx.table->rows;
        unsigned end = selUpperBound(ctx.table);
        s = moveRow(ctx.table, start, end);
    }
    return s;
}
State irow_cmd ( Context ctx ) { if ( ctx . argStr [ 0 ] != ' \0 ' ) return ERR_BAD_SYNTAX ; State s ; s = addRow ( ctx . table ) ; if ( s == SUCCESS ) { unsigned start = ctx . table -> rows ; unsigned end = selUpperBound ( ctx . table ) ; s = moveRow ( ctx . table , start , end ) ; } return s ; }
inserts a row right above the selected region
inserts a row right above the selected region
// start on the last line // and swap until you get to the top of selection // move the empty row up to the selection