From ca7ec13f3be1235629221514f0683f722f45a349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 14 Jul 2020 10:50:38 +0200 Subject: [PATCH] term: insert: move assert() after checking whether insert mode is enabled or not --- terminal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terminal.c b/terminal.c index 4ed34f63..27bfba8f 100644 --- a/terminal.c +++ b/terminal.c @@ -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);