term: insert: move assert() after checking whether insert mode is enabled or not

This commit is contained in:
Daniel Eklöf 2020-07-14 10:50:38 +02:00
parent 01c3a2635d
commit ca7ec13f3b
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -2364,11 +2364,11 @@ print_linewrap(struct terminal *term)
static inline void
print_insert(struct terminal *term, int width)
{
assert(width > 0);
if (likely(!term->insert_mode))
return;
assert(width > 0);
struct row *row = term->grid->cur_row;
const size_t move_count = max(0, term->cols - term->grid->cursor.point.col - width);