Browse Source

Fix bad line reference when unhighlighting parens while splitting

K. Lange 8 months ago
parent
commit
218891202a
1 changed files with 4 additions and 4 deletions
  1. 4 4
      bim.c

+ 4 - 4
bim.c

@@ -1442,16 +1442,16 @@ line_t ** split_line(line_t ** lines, int line, int split) {
 		HIST_APPEND(e);
 	}
 
+	if (!env->loading) {
+		unhighlight_matching_paren();
+	}
+
 	/* Allocate more space as needed */
 	if (env->line_count == env->line_avail) {
 		env->line_avail *= 2;
 		lines = realloc(lines, sizeof(line_t *) * env->line_avail);
 	}
 
-	if (!env->loading) {
-		unhighlight_matching_paren();
-	}
-
 	/* Shift later lines down */
 	if (line < env->line_count) {
 		memmove(&lines[line+2], &lines[line+1], sizeof(line_t *) * (env->line_count - line));