From b5ed4cf757afc50afb6ac499eee7b87a2648fa4c Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Thu, 6 Apr 2023 21:47:09 +0200 Subject: fix what I messed up Undo was relying on buffer_goto being 0-indexed when it comes to lines, whereas the new --line flag was not. --- src/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/buffer.c') diff --git a/src/buffer.c b/src/buffer.c index 9e181e5..23a8ab1 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -330,7 +330,7 @@ bool moveh(struct buffer *buffer, int coldelta) { } void buffer_goto(struct buffer *buffer, uint32_t line, uint32_t col) { - int64_t linedelta = (int64_t)line - 1 - (int64_t)buffer->dot.line; + int64_t linedelta = (int64_t)line - (int64_t)buffer->dot.line; movev(buffer, linedelta); int64_t coldelta = (int64_t)col - (int64_t)buffer->dot.col; -- cgit v1.2.3