3 ms·
I'd add that the assumptions that the specialized data structures (gap buffer and piece table) make are easily violated—someone mentioned a search-replace furth
by marijn 9y ago
I'd add that the assumptions that the specialized data structures (gap buffer and piece table) make are easily violated—someone mentioned a search-replace further down—at which point I can imagine their performance degrading unless special measure, i.e. more complexity, are added.
So yeah, in my editor (CodeMirror) I'm also using a rope/tree style representation [1], because it's pleasantly general and easy to reason about.
[1]: http://marijnhaverbeke.nl/blog/codemirror-line-tree.html http://marijnhaverbeke.nl/blog/codemirror-line-tree.html