tFix deletion across line breaks - ve - a minimal text editor (work in progress) | |
git clone git://src.adamsgaard.dk/ve | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 7d3b3faea7d394ca5bb439bcccac82588698c800 | |
parent 670187416f021e651072fe6b467ba1a0204b6ebc | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 6 Aug 2019 20:38:32 +0200 | |
Fix deletion across line breaks | |
Diffstat: | |
M row.c | 4 ++-- | |
1 file changed, 2 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/row.c b/row.c | |
t@@ -99,9 +99,9 @@ editor_row_append_string(eRow *row, char *s, size_t len) | |
void | |
editor_row_delete_char(eRow *row, int i) | |
{ | |
- if (i<0 || i>row->size) | |
+ if (i<0 || i>=row->size) | |
return; | |
- memmove(&row->chars[i], &row->chars[i+1], row->size-i); | |
+ memmove(&row->chars[i], &row->chars[i+1], row->size - i); | |
row->size--; | |
editor_row_update(row); | |
E.file_changed = 1; |