Skip to content

Commit

Permalink
patch 8.1.0037: cannot easily append lines to another buffer
Browse files Browse the repository at this point in the history
Problem:    Cannot easily append lines to another buffer.
Solution:   Add appendbufline().
  • Loading branch information
brammool committed Jun 6, 2018
1 parent 891e1fd commit ca85159
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 168 deletions.
15 changes: 15 additions & 0 deletions runtime/doc/eval.txt
Expand Up @@ -2560,6 +2560,21 @@ append({lnum}, {expr}) *append()*
0 for success. Example: > 0 for success. Example: >
:let failed = append(line('$'), "# THE END") :let failed = append(line('$'), "# THE END")
:let failed = append(0, ["Chapter 1", "the beginning"]) :let failed = append(0, ["Chapter 1", "the beginning"])
appendbufline({expr}, {lnum}, {text}) *appendbufline()*
Like |append()| but append the text in buffer {expr}.

For the use of {expr}, see |bufname()|.

{lnum} is used like with |append()|. Note that using |line()|
would use the current buffer, not the one appending to.
Use "$" to append at the end of the buffer.

On success 0 is returned, on failure 1 is returned.

If {expr} is not a valid buffer or {lnum} is not valid, an
error message is given. Example: >
:let failed = appendbufline(13, 0, "# THE START")
< <
*argc()* *argc()*
argc() The result is the number of files in the argument list of the argc() The result is the number of files in the argument list of the
Expand Down

0 comments on commit ca85159

Please sign in to comment.