Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by EdiX

11 years ago

This data structure is called gap buffer, it's rather common in text editors because it's simple to implement and efficient on the most common use cases.

In the usual implementation the gap is only moved when you actually insert text, not when the cursor is moved, which makes it even more efficient.

0 comments

EdiX

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities