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

List:       vim-dev
Subject:    Re: missing setbufline()?
From:       Bram Moolenaar <Bram () moolenaar ! net>
Date:       2006-10-24 11:03:17
Message-ID: 200610241103.k9OB3H5x053642 () moolenaar ! net
[Download RAW message or body]


Yegappan Lakshmanan wrote:

> On 10/23/06, Bram Moolenaar <Bram@moolenaar.net> wrote:
> >
> > >
> > > You can try the attached patch against the latest Vim7 sources.
> > > The syntax of the new function is:
> > >
> > >             setbufline({expr}, {lnum}, {line})
> > >
> > > where, {expr} specifies the loaded buffer name/number, {lnum} specifies
> > > a valid line number in that buffer and {line} is either a single line
> > > or a List of lines.
> > >
> > > Note. The patch also includes the new gettabvar() and settabvar()
> > > functions.
> >
> > It looks like after this patch, if you change lines in another buffer
> > some marks in the current window will be moved.  Especially the
> > jumplist, perhaps setting cmdmod.lockmarks would help.
> >
> 
> I tried to reproduce this problem using the new setbufline()
> function. The jumplist for the current buffer is not affected
> while changing the contents of another loaded buffer using
> the setbufline() function. Is there any specific sequence that
> needs to be followed to see this problem?
> 
> >
> > The '< and '> marks are probably moved.  Manual folds might be moved.
> >
> 
> I couldn't reproduce the above problems also. The manual folds
> and the visual area marks for the current buffer are not changed
> by setbufline().
> 
> >
> > There may also be redrawing problems.
> >
> 
> I didn't see any redraw problems. Are you referring to redraw
> problems in the current buffer or in the buffer that is being
> changed using setbufline()?

The thing is that changes are made to another buffer while using the
current window.  This may change information in the current window that
is wrong for when the buffer originally edited in it has been put
back.

I can't predict what exactly would go wrong or how to trigger that.  The
functions that are invoked are appended_lines_mark() and
changed_bytes().  You probably need to try with the current buffer
having more lines than the buffer being changed.

-- 
Common sense is what tells you that the world is flat.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
[prev in list] [next in list] [prev in thread] [next in thread] 

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