From 14eecc567ab69ae376eaa0d86793eea36e7464b1 Mon Sep 17 00:00:00 2001 From: David Klassen Date: Fri, 6 Feb 2026 23:54:00 +0700 Subject: [PATCH] Fix row index update direction in editorDelRow --- kilo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kilo.c b/kilo.c index 0d8aef4e..e32fd954 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++; }