An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

github.com/Release-Candidate/go-gap-buffer

This library implements a gap buffer, which is a data structure to be used as the container of the text for a (simple or not so simple) text editor. Movements to the left or right and deletion to the left and right work on Unicode runes. It supports line movements (up and down a line from the current one), it splits lines based on the newline character '\n'. Caveats: A gap buffer is an array with a "gap" - unused elements in the array - at the cursor position, where text is to be inserted and deleted. The string "Hello world!" with the cursor at the end of "Hello" - "Hello| world!" - looks like this in a gap buffer array: Movement in the gap buffer works by moving the start and end of the gap, same with deletion of unicode runes in both directions. Moving the cursor two runes to the left: Deleting three runes to the left: Insertion happens at the cursor position by appending at the start of the gap and moving the start of the gap accordingly. New|< gap start, the cursor position gap end >|lo world! Implementation Detail: The line lengths are stored in a another gap buffer, which is synchronized with the gap buffer of the text itself.

Ecosystem
proxy.golang.org
Latest Release
v0.2.1
about 2 years ago
Versions
3
Links
Registry proxy.golang.org
Source Repository
Docs Documentation
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:golang/github.com/%21release-%21candidate/go-gap-buffer
spec
License MIT
Namespace github.com/Release-Candidate
First Release about 2 years ago
Last Synced 8 days ago
Repository
Stars 0 on GitHub
Forks 0 on GitHub
Rankings on proxy.golang.org
Overall Top 9.3%