2022-04-02 16:12:22 +00:00
|
|
|
void
|
2022-04-03 08:05:25 +00:00
|
|
|
c_indent(char *c, char **argv) {
|
2022-04-02 16:12:22 +00:00
|
|
|
Row *row = b_getline(buffer, atoi(c + 2));
|
|
|
|
if (row == NULL) { puts ("invalid line"); return; }
|
|
|
|
|
|
|
|
|
|
|
|
for(int i = ROW_SIZE - 1; i >= 1; i--) {
|
|
|
|
row->text[i] = row->text[i - 1];
|
|
|
|
}
|
|
|
|
row->text[0] = '\t';
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2022-04-03 08:05:25 +00:00
|
|
|
c_unindent(char *c, char **argv) {
|
2022-04-02 16:12:22 +00:00
|
|
|
Row *row = b_getline(buffer, atoi(c + 2));
|
|
|
|
if (row == NULL) { puts ("invalid line"); return; }
|
|
|
|
|
|
|
|
for(int i = 0; i < ROW_SIZE - 1; i++) {
|
|
|
|
row->text[i] = row->text[i + 1];
|
|
|
|
}
|
2022-04-02 21:08:42 +00:00
|
|
|
row->text[ROW_SIZE - 1] = 0;
|
2022-04-02 16:12:22 +00:00
|
|
|
}
|
|
|
|
|
2022-04-02 21:08:42 +00:00
|
|
|
|
2022-04-03 08:05:25 +00:00
|
|
|
|