From 7fb02495235d0d3532af1a50562d3ec542463e53 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 3 Feb 2022 17:27:26 -0800 Subject: [PATCH] fix a typo when deleting a row --- kilo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kilo.c b/kilo.c index 406eb7be..ca1d0674 100644 --- a/kilo.c +++ b/kilo.c @@ -625,7 +625,7 @@ void editorDelRow(int at) { row = E.row+at; editorFreeRow(row); memmove(E.row+at,E.row+at+1,sizeof(E.row[0])*(E.numrows-at-1)); - for (int j = at; j < E.numrows-1; j++) E.row[j].idx++; + for (int j = at; j < E.numrows-1; j++) E.row[j].idx--; E.numrows--; E.dirty++; }