On 28/08/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:

Brad Beveridge wrote:

> Hi, sorry for all the trouble :)  I'm having redraw issues, where
> running this code to append chars is causing strange problems.
> The scenario is this (always using the code below for char output):
> 1) Write a char to a buffer (line1)
> 2) Write a newline (line 2)
> 3) Move the cursor to the bottom of the buffer (line2 empty)
> 4) Write another Char (appears in line2)
> 5) Press Ctrl-L
> 6) Notice that line1 has vanished.
>
> moving the cursor to the new blank line at the bottom of the line is
> critical here.  I'm sure that I'm doing something wrong, but I really
> can't figure it out.
> As a side note, it feels very clumsy to have to manually call "changed
> line" functions when calling ml_* funcs - is there some notes I can
> read about why this is?

The screen updating code doesn't want to redraw everything all the time.
Thus you must somehow specify what text got changed/inserted/deleted.
If you don't do that you might indeed see redraw problems that go away
when using CTRL-L.
Actually, it is just the opposite - the screen looks fine UNTIL I
press CTRL-L :)


You are doing low level stuff here, thus you must take care of all these
things yourself.
I guess that is fair enough.


<snip code>

Do you save text for undo somewhere?  That should be done for every
change that is being made, otherwise undo won't work.

For right now I'm not concerned about undo.  Probably later I'll add
undo at the per-line level.

Cheers
Brad

Reply via email to