mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-08 08:20:59 -04:00
term: print_insert: early return
This commit is contained in:
parent
97221dd09b
commit
9df7e8fa07
1 changed files with 12 additions and 11 deletions
|
|
@ -2353,7 +2353,9 @@ print_insert(struct terminal *term, int width)
|
||||||
{
|
{
|
||||||
assert(width > 0);
|
assert(width > 0);
|
||||||
|
|
||||||
if (unlikely(term->insert_mode)) {
|
if (likely(!term->insert_mode))
|
||||||
|
return;
|
||||||
|
|
||||||
struct row *row = term->grid->cur_row;
|
struct row *row = term->grid->cur_row;
|
||||||
const size_t move_count = max(0, term->cols - term->grid->cursor.point.col - width);
|
const size_t move_count = max(0, term->cols - term->grid->cursor.point.col - width);
|
||||||
|
|
||||||
|
|
@ -2366,7 +2368,6 @@ print_insert(struct terminal *term, int width)
|
||||||
for (size_t i = term->grid->cursor.point.col + width; i < term->cols; i++)
|
for (size_t i = term->grid->cursor.point.col + width; i < term->cols; i++)
|
||||||
row->cells[i].attrs.clean = 0;
|
row->cells[i].attrs.clean = 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
term_print(struct terminal *term, wchar_t wc, int width)
|
term_print(struct terminal *term, wchar_t wc, int width)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue