aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-14 08:50:38 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-14 08:50:38 +0000
commitca7ec13f3be1235629221514f0683f722f45a349 (patch)
tree14064aa59732eb967f376589e74da1e95ca9e884
parentterm: linefeed: explicitly clear LCF (diff)
term: insert: move assert() after checking whether insert mode is enabled or not
-rw-r--r--terminal.c4
1 files 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);