From cd4829ad5d4d873d188d5f532e0ac82a91c5f9ed Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Tue, 14 May 2024 21:17:30 +0200 Subject: Fix replace not updating after a replace op If the replace happened on the same line as another match and was longer or shorter than the previous value, the highlights and following replaces would be offset. --- src/dged/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dged') diff --git a/src/dged/buffer.c b/src/dged/buffer.c index c1d9280..9eab505 100644 --- a/src/dged/buffer.c +++ b/src/dged/buffer.c @@ -880,7 +880,7 @@ struct location buffer_cut(struct buffer *buffer, struct region region) { struct location buffer_delete(struct buffer *buffer, struct region region) { if (buffer->readonly) { minibuffer_echo_timeout(4, "buffer is read-only"); - return region.end; + return region.begin; } if (!region_has_size(region)) { -- cgit v1.2.3