Thread overview
gap buffer in D2
Nov 04, 2009
BLS
Nov 05, 2009
Spacen Jasset
Nov 05, 2009
BLS
Nov 06, 2009
Spacen Jasset
Nov 06, 2009
Spacen Jasset
November 04, 2009
yep, mean it...

has somebody done it before...to me it seems to be not as trivial as it looks on the very first view. (speed matters)


November 05, 2009
BLS wrote:
> yep, mean it...
> 
> has somebody done it before...to me it seems to be not as trivial as it looks on the very first view. (speed matters)
> 
> 
Did one in C once for an editor (of course). Does that count? I might be able to find the code. It might not be pretty I can't remember.
November 05, 2009
On 05/11/2009 01:04, Spacen Jasset wrote:
> BLS wrote:
>> yep, mean it...
>>
>> has somebody done it before...to me it seems to be not as trivial as
>> it looks on the very first view. (speed matters)
>>
>>
> Did one in C once for an editor (of course). Does that count? I might be
> able to find the code. It might not be pretty I can't remember.

YEP,would be nice to have a look. thanks!

would be interesting to have a 2 gaps buffer for beyond-end insert (append)
November 06, 2009
BLS wrote:
> On 05/11/2009 01:04, Spacen Jasset wrote:
>> BLS wrote:
>>> yep, mean it...
>>>
>>> has somebody done it before...to me it seems to be not as trivial as
>>> it looks on the very first view. (speed matters)
>>>
>>>
>> Did one in C once for an editor (of course). Does that count? I might be
>> able to find the code. It might not be pretty I can't remember.
> 
> YEP,would be nice to have a look. thanks!
> 
> would be interesting to have a 2 gaps buffer for beyond-end insert (append)
Perhaps, if you expect things to be inserted in the middle and at the end at the same time/alternately.

I can't quite remember why I have this gap buffer. I do remember that I was going to have some sort of linked list of gap buffers for editing large files. The code should work. It's used in an old hex editor which works ok.

http://dl.dropbox.com/u/731271/GapBuffer/GapBuffer.C
and
http://dl.dropbox.com/u/731271/GapBuffer/GapBuffer.h

November 06, 2009
Spacen Jasset wrote:
> BLS wrote:
>> On 05/11/2009 01:04, Spacen Jasset wrote:
>>> BLS wrote:
>>>> yep, mean it...
>>>>
>>>> has somebody done it before...to me it seems to be not as trivial as
>>>> it looks on the very first view. (speed matters)
>>>>
>>>>
>>> Did one in C once for an editor (of course). Does that count? I might be
>>> able to find the code. It might not be pretty I can't remember.
>>
>> YEP,would be nice to have a look. thanks!
>>
>> would be interesting to have a 2 gaps buffer for beyond-end insert (append)
> Perhaps, if you expect things to be inserted in the middle and at the end at the same time/alternately.
> 
> I can't quite remember why I have this gap buffer. I do remember that I was going to have some sort of linked list of gap buffers for editing large files. The code should work. It's used in an old hex editor which works ok.
> 
> http://dl.dropbox.com/u/731271/GapBuffer/GapBuffer.C
> and
> http://dl.dropbox.com/u/731271/GapBuffer/GapBuffer.h
> 
By the way. it's isn't very quick at all. Some memcpy's would be required at least, rather than the for loops.