On 8/16/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:
There are only a few operations that profit from a "gap" strategy. Overall it gets much more complicated and inefficient. You would have to move the gap around for every change made.
Not quite true. You'd have to move it around for every /length-altering/ change made (but non-length-altering changes work well without a gap as well). And considering that insertion is the most common operation and that it's one of the operations that would benefit, it's a trade-off that may or may not benefit buffer modification as a whole. Still, I suppose the most common scenario for the most common operation is insertion at the end of a line, which I assume there /is/ support for in Vim already, i.e., allocating some additional space for every loaded line so that one doesn't have to realloc() for every insertion. Remember: Emacs uses the gap strategy for the whole buffer, and I haven't seen this to be particularly inefficient. The big problem is the continuity of the buffer in memory, which isn't much of a problem on a per-line basis. nikolai