mirror of
https://github.com/ascii-boxes/boxes.git
synced 2025-06-20 01:37:52 +02:00
Restore indentation mode on box removal
This commit is contained in:
parent
f739343c29
commit
0eed7422f6
@ -1009,11 +1009,19 @@ static void remove_vertical_from_input(remove_ctx_t *ctx)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
bxstr_t *temp2 = bxs_substr(org_line, s_idx, e_idx);
|
bxstr_t *temp2 = bxs_substr(org_line, s_idx, e_idx);
|
||||||
|
if (opt.indentmode == 'b' || opt.indentmode == '\0') {
|
||||||
|
/* restore indentation */
|
||||||
bxstr_t *temp = bxs_prepend_spaces(temp2, input.indent);
|
bxstr_t *temp = bxs_prepend_spaces(temp2, input.indent);
|
||||||
free_line_text(input.lines + input_line_idx);
|
free_line_text(input.lines + input_line_idx);
|
||||||
input.lines[input_line_idx].text = temp;
|
input.lines[input_line_idx].text = temp;
|
||||||
bxs_free(temp2);
|
bxs_free(temp2);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
/* remove indentation */
|
||||||
|
free_line_text(input.lines + input_line_idx);
|
||||||
|
input.lines[input_line_idx].text = temp2;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user