Hi Hari,

On 10/22/06, Yegappan Lakshmanan <[EMAIL PROTECTED]> wrote:
Hi Hari,

On 10/22/06, Hari Krishna Dara <[EMAIL PROTECTED]> wrote:
> > On 10/22/06, Hari Krishna Dara <[EMAIL PROTECTED]> wrote:
> > >
> > > I see functions for creating new unlisted buffers (bufnr() with {create}
> > > option), and for reading the lines from the buffer using getbufline(),
> > > all without having to change the current buffer, but I don't see a
> > > setbufline() so there is no way to set the lines without having to
> > > switch to it. Is there a reason to leave this circle incomplete?
> > >
> >
> > Yes. I had a patch for the setbufline() function last year. There were
> > several problems with it. So it was not included in Vim7 and only
> > the getbufline() function was included.
> >
> > The setbufline() function worked only for loaded buffers. The undo
> > history was not updated correctly.
> >
> > But I agree that it will be good to have the setbufline() function.
> >
> > - Yegappan
>
> Nice, so it will be included at some point after resolving these issues.
>

You can try the attached patch against the latest Vim7 sources.


With this patch you should not see the above mentioned problems
with undo. Let me know if you see any other problems in using
the setbufline() function with this patch. If there are no problems,
then I will send this to Bram for inclusion in a future Vim release.

- Yegappan

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.

- Yegappan

Reply via email to