

Which basically loads a the whole file into an immutable buffer and then uses the PieceTree to manage the edits. Monaco - The editor in VS Code recently went from a linked-list of strings to a PieceTree buffer.

It doesn't suffer though as much from heap fragmentation though as the linked-list of strings type approach. it will be sluggish, but if you do, like %!jq '.' and format it, you can them move around the file a little easier.Įmacs - Historically used a Gap-Buffer which optimized more for locality of edits than loading large files. Vim's implementation also feels somewhat line-oriented in that if you load a large JSON file that has everything on 1 line and you try to edit that line, uh. It's vaguely reminiscent of Vim's implementation, in the sense that I think, for large files, in it's default config, Vim keeps most of the text in it's swap file and pages it in as needed.
