From 8ab6286f1a85ee217f074ccf9bd66e45e9bd81d8 Mon Sep 17 00:00:00 2001 From: GrenderG Date: Tue, 11 Apr 2017 02:55:24 +0200 Subject: [PATCH] Solved an issue when cutting the last line of a file. --- tte.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tte.c b/tte.c index 65cbe86..0344297 100644 --- a/tte.c +++ b/tte.c @@ -916,7 +916,7 @@ void editorCut() { editorUpdateSyntax(&ec.row[ec.cursor_y]); if (ec.num_rows - ec.cursor_y > 1) editorUpdateSyntax(&ec.row[ec.cursor_y + 1]); - ec.cursor_x = ec.row[ec.cursor_y].size - (ec.cursor_y == ec.num_rows); + ec.cursor_x = ec.cursor_y == ec.num_rows ? 0 : ec.row[ec.cursor_y].size; } void editorPaste() {