From 51a1bd01cd98daca2c3f374d7d2cbe96f88e4c0c Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 6 Jul 2024 23:34:49 +0100 Subject: [PATCH] posts: gap-buffer: add presentation --- content/posts/2024-07-06-gap-buffer/index.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/content/posts/2024-07-06-gap-buffer/index.md b/content/posts/2024-07-06-gap-buffer/index.md index fa8f1c5..d13ef4e 100644 --- a/content/posts/2024-07-06-gap-buffer/index.md +++ b/content/posts/2024-07-06-gap-buffer/index.md @@ -23,3 +23,13 @@ represent files and editable buffers. The most famous of them probably being [emacs]: https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-Gap.html + +## What does it do? + +A _Gap Buffer_ is simply a list of characters, similar to a normal string, with +the added twist of splitting it into two side: the prefix and suffix, on either +side of the cursor. In between them, a gap is left to allow for quick +insertion at the cursor. + +Moving the cursor moves the gap around the buffer, the prefix and suffix getting +shorter/longer as required.