Reputation: 156
I know that Notepad++ used Gap Buffer, and XI editor used Rope. But I don't know which data structure behind the Visual Studio Code.
Do you know which data structure used in Visual Studio Code?
Upvotes: 0
Views: 927
Reputation: 2493
Based on an article on the Visual Studio website about how the text buffer was implemented for Visual Studio Code 1.21, the text buffer is apparently represented by a piece table - a data structure that stores the initial text in one node, and then subsequent edits in other nodes.
They then improved its performance by:
to get what the author calls a "Multiple buffer piece table with red-black tree, optimized for line model" and then immediately shortens to "piece tree".
Upvotes: 2