[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kant
Subject:    [Kde-kant] Re: Hi - Little problem with kate buffer ;)
From:       Christoph Cullmann <crossfire () babylon2k ! de>
Date:       2001-11-17 13:33:38
[Download RAW message or body]

Am Friday 09 November 2001 21:40 schrieben Sie:
> On Friday 09 November 2001 12:18 pm, Christoph Cullmann wrote:
> > > Does it work better if you update?
> >
> > Better :) thx.
> > An other thingy: the selection does disappear blockwise (if I count the
> > bytes right ;) Any idea why ? Could be an other problem too, but is very
> > curious.
>
> I have a suspicion.. the textlines are swapped out to disk and swapped back
> in to keep memory usage aceptable for large files. It seems that
> "selections" are stored somehow in the TextLine objects.
>
> Now, if we have a block of textlines that have been swapped out and swapped
> in again, we don't write them to disk again if they hadn't changed. So it
> can happen that we throw away the block and then when we need it again we
> swap it back in. If the attributes that indicate that the line have been
> selected had changed they will now be lost.
>
> The same probably goes for the highlighting.
>
> The simple and not so smart solution is to call KateBuffer::changeLine()
> whenever the selection of a line or the highlighting changes. This is not
> very smart, because if you select all the text it means that the whole text
> will be written out to disk again.. goodbye performance.
>
> For the selection, the smart way is to detect any selections in a block of
> textlines and keep that information around when the data itself is swapped
> out. When the data is swapped in again we can then restore the selection
> informatin.
>
> For the highlighting, the smart way is to throw out the highlighting
> information and only remember the highlighting state-information for the
> start of the block. When the block gets swapped in, the KateBuffer can then
> emit a signal to request the highlighting to be restored for a certain
> number of lines based on the highlighting state of the start of the lines.
>
> As far as the selections go,this is all based on the assumption that the
> selection information is stored in the TextLine somehow. If someone can
> explain me how this is done, I might be able to handle it smart in
> KateBuffer.
The selection problem is solved (selection is a bit buggy at the moment, but 
that will become better soon) ;)
Now Kate only stores in the katedocument the line/col of selection start/end 
;), no longer a bitmask on the attributes. But the highlighting would benefit 
from your ideas very much ;)

cu
Christoph

>
> Cheers,
> Waldo
-- 
| |   / /               - get an edge in editing -
| | / /                      »»»» GET KATE ««««
| |/ /      a fast and capable multiple document,
|     \     multiple view text editor for KDE
| |\  \     cullmann@kde.org
| |  \  \   http://kate.sf.net


_______________________________________________
kde-kant mailing list
kde-kant@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-kant

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic