{"id":15393581,"url":"https://github.com/daurnimator/zig-piecetable","last_synced_at":"2025-07-01T08:04:32.029Z","repository":{"id":137805039,"uuid":"411776441","full_name":"daurnimator/zig-piecetable","owner":"daurnimator","description":"A PieceTable data structure for zig","archived":false,"fork":false,"pushed_at":"2021-09-29T17:52:32.000Z","size":3,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-24T15:29:06.155Z","etag":null,"topics":["datastructures","piecetable","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daurnimator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-29T17:52:04.000Z","updated_at":"2024-08-13T14:11:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"7acbc11d-06ca-45e8-a5b4-513b39743424","html_url":"https://github.com/daurnimator/zig-piecetable","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"5b1f35757bfe720eeb61c4863ccfd1fe7351f8a1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daurnimator%2Fzig-piecetable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daurnimator%2Fzig-piecetable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daurnimator%2Fzig-piecetable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daurnimator%2Fzig-piecetable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daurnimator","download_url":"https://codeload.github.com/daurnimator/zig-piecetable/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228544802,"owners_count":17934648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datastructures","piecetable","zig"],"created_at":"2024-10-01T15:19:42.206Z","updated_at":"2025-07-01T08:04:32.019Z","avatar_url":"https://github.com/daurnimator.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zig PieceTable\n\n## Overview\n\nA piece table is made of two buffers, the original content and a new append only \"add\" buffer.\nWe start with a \"span\" that covers the entire original buffer, and for every modification we\ndivide that up based on where hte insert or delete is performed and how many characters it is.\n\nEach of these operations represented as new spans are made into the new \"add\" buffer, leaving\nthe original as is. Each piece or span therefore references three things:\n\n1. Is it referencing original content or new content (i.e. original or add buffer)\n2. The offset to the start of the change\n3. Number of bytes that are being changed after the offset.\n\nSpans are listed in order in a table (hence piece table), which can be traversed from top to\nbottom for a consistent history of changes.\n\n## Usage\n\nTo use in your Zig project, pick a commit hash you want to use and run the following,\nreplacing `\u003chash\u003e` with the commit hash:\n\n```bash\nzig fetch --save=piecetable https://github.com/daurnimator/zig-piecetable/archive/\u003chash\u003e.tar.gz\n```\n\n## References\n\n* https://en.wikipedia.org/wiki/Piece_table\n* https://www.averylaird.com/programming/the%20text%20editor/2017/09/30/the-piece-table/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaurnimator%2Fzig-piecetable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaurnimator%2Fzig-piecetable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaurnimator%2Fzig-piecetable/lists"}