Get the latest tech news
Implementing attributes for plain text using subranges like Emacs
- Inserting/deleting text before a range moves it. - Inserting/deleting text after a range leaves it unchanged.
Emacs-style ranges on a text buffer that I can now hang attributes like color, decorations and click handlers on to. This quickly blew up the implementation to 500 lines, and I was juggling 27 manual tests of which half were failing. But I blindly assumed a fully normalized design with a first-class notion of a pivot must be a good idea.
Or read this on Hacker News