https://github.com/stylewarning/cl-gap-buffer
https://github.com/stylewarning/cl-gap-buffer
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/stylewarning/cl-gap-buffer
- Owner: stylewarning
- License: bsd-3-clause
- Created: 2023-04-09T22:05:45.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-04-09T22:15:23.000Z (about 3 years ago)
- Last Synced: 2025-03-25T23:34:10.341Z (over 1 year ago)
- Language: Common Lisp
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
#+TITLE: The =CL-GAP-BUFFER= Library
#+AUTHOR: Robert Smith
#+EMAIL: quad@symbo1ics.com
* Summary
A small library for efficient-local-insertion strings represented as
gap buffers. It operates efficiently for cursor-based editing.
* Usage
The principle use follows. Mutable operations' output is elided.
Create a gap buffer.
: > (defparameter buf (make-gap-buffer))
Add some data to it.
: > (gap-buffer-insert-string buf "hello")
: > (gap-buffer-string buf)
: "hello"
: > (gap-buffer-insert-char buf #\a)
: > (gap-buffer-string buf)
: "helloa"
Move about in the gap buffer.
: > (gap-buffer-move-left buf)
: > (gap-buffer-move-left buf)
: > (gap-buffer-insert-char buf #\y)
: > (gap-buffer-string buf)
: "hellyoa"
Remove characters.
: > (gap-buffer-move-right buf)
: > (gap-buffer-backspace buf)
: > (gap-buffer-string buf)
: "hellya"
: > (gap-buffer-insert-char buf #\e)
: > (gap-buffer-string buf)
: "hellyea"
: > (gap-buffer-delete buf)
: > (gap-buffer-string buf)
: "hellye"
: > (gap-buffer-insert-char buf #\s)
: > (gap-buffer-string buf)
: "hellyes"
* Dependencies
None.
* License
See the file ~LICENSE~.
----------
### End of file