Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yah I'd read that, so I looked for signs of a piece table, but couldn't find any. Which doesn't necessarily mean that it isn't using one.

I suspect that Sublime Text either doesn't use a piece table, or uses one that only breaks pieces at line boundaries. The reason being that the highlighting relies on running regexes on one line at a time, and it uses oniguruma for this sometimes, and oniguruma requires the entire haystack to be in one array. However, Sublime doesn't highlight super long lines because it would be too slow, so it could break its piece table on incredibly long lines so that editing them could still be fast.

I was also looking for fancy rendering and highlighting tricks, but couldn't decipher any.



Re: data structures, ST could also use ropes, or gap buffers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: