📄 interval.ideas
字号:
This idea comes from Andrew. The basic part is to represent a divisionof the buffer into disjoint intervals by means of a binary tree. Eachinterval has one node. The tree has the effect of a large orderedcollection of markers, but no Lisp_Marker objects appear in the tree.Each node has two subnodes, a left and a right, each of which can benil instead. The subnodes' intervals are disjoint from their parent'sinterval--the tree structure is for binary searching.Each node in the tree is implicitly associated with a region of thebuffer, but I don't think it actually stores the positions; I think ithas the length of that node, or perhaps its own length and separatelythe length of it plus all its subnodes.I forget the details of this, but the idea is that you can figure outthe position of a node, or find the node containing a position, byexamining just its superiors in the tree, and you can also update thetree for changes in the buffer by tracing just one path down the tree.So the amount of work for nearly any operation goes with the log ofthe number of intervals.If it is desirable to be able to subdivide the intervals, each intervalcan have another such tree dividing it into disjoint subintervals. Andsubintervals can have trees, too. So it becomes a tree of trees.The idea is to associate an alist with each interval or subinterval.The complete alist associated with any spot is the append of thealists of the containing intervals at all levels of subdivision,smallest ones first. It would also be useful to get the bounds of theinnermost interval.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -