From 0b524a94a5e34148716832f1b6cada02e35369b0 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Mon, 12 Feb 2024 16:28:37 +0100 Subject: Improve word deletion Now it only deletes the word under dot. --- src/dged/buffer.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/dged/buffer.h') diff --git a/src/dged/buffer.h b/src/dged/buffer.h index 2e71fb3..3cb8d03 100644 --- a/src/dged/buffer.h +++ b/src/dged/buffer.h @@ -244,6 +244,17 @@ struct location buffer_next_word(struct buffer *buffer, struct location dot); */ struct location buffer_next_line(struct buffer *buffer, struct location dot); +/** + * Get the extents of the word located at @ref at. + * + * @param [in] buffer The buffer to look in. + * @param [in] at The location to start from. + * + * @returns The extent of the closest word as a region. If + * there is no word, the region will be zero-sized. + */ +struct region buffer_word_at(struct buffer *buffer, struct location at); + /** * Clamp a buffer position to the boundaries of the buffer. * -- cgit v1.2.3