|
|
|
|
|
by alpaca128
1107 days ago
|
|
Text is usually stored as tree either way in an editor, using a DOM-like approach might work well on top of the usual datastructures. > with the DOM the selection can start from a node with node-specific subrange (e.g. character in a text node) and end with another node and both being very unrelated to each other I'd just store the range as character indices, using those the right nodes in the tree can be accessed pretty quickly as needed. |
|