3 ms·
Vim needs to do a lot more special stuff, because it has to handle random insertions and deletions. Doing those things to a file (mmaped or otherwise) requires
by rocqua 8y ago
Vim needs to do a lot more special stuff, because it has to handle random insertions and deletions.
Doing those things to a file (mmaped or otherwise) requires moving all data after the edit.
If I recall correctly, vim/vi uses a linked list of 'chunks' that is dynamically merged. For long files I would expect some form of lazy loading of chunks.
- dullgiulio 8y agoThat's right. The key data structure is the rope: https://en.wikipedia.org/wiki/Rope_(data_structure) https://en.wikipedia.org/wiki/Rope_(data_structure)
- deleted 8y ago[deleted]
- snarfy 8y agoNice! I thought xi was the only editor that used ropes.