Skip to content

Commit

Permalink
taa
Browse files Browse the repository at this point in the history
  • Loading branch information
tsjensen committed Dec 3, 2023
1 parent c46b7da commit 89d053f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions src/remove.c
Original file line number Diff line number Diff line change
Expand Up @@ -1009,10 +1009,18 @@ static void remove_vertical_from_input(remove_ctx_t *ctx)
#endif

bxstr_t *temp2 = bxs_substr(org_line, s_idx, e_idx);
bxstr_t *temp = bxs_prepend_spaces(temp2, input.indent);
free_line_text(input.lines + input_line_idx);
input.lines[input_line_idx].text = temp;
bxs_free(temp2);
if (opt.indentmode == 'b' || opt.indentmode == '\0') {
/* restore indentation */
bxstr_t *temp = bxs_prepend_spaces(temp2, input.indent);
free_line_text(input.lines + input_line_idx);
input.lines[input_line_idx].text = temp;
bxs_free(temp2);
}
else {
/* remove indentation */
free_line_text(input.lines + input_line_idx);
input.lines[input_line_idx].text = temp2;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/190_remove_blank_nw_lines.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ Note that the NW corner is mostly blank (except its very bottom), which triggers
(__/ \__)
:OUTPUT-FILTER
:EXPECTED
foobar
foobar
:EOF

0 comments on commit 89d053f

Please sign in to comment.