diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2016-03-15 12:56:45 +0100 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2016-04-01 11:30:00 +0200 |
commit | 6eda7c0e5f934d3387805033c6404b5ac2dcbd7d (patch) | |
tree | b1c2f32a604410924dbeff121b72984d3de12f23 | |
parent | 8eb8ebf905e47c2e2354306e5abfc07e90e40e2b (diff) | |
download | rneovim-6eda7c0e5f934d3387805033c6404b5ac2dcbd7d.tar.gz rneovim-6eda7c0e5f934d3387805033c6404b5ac2dcbd7d.tar.bz2 rneovim-6eda7c0e5f934d3387805033c6404b5ac2dcbd7d.zip |
api/buffer: deprecate old line and line slice functions
-rw-r--r-- | src/nvim/api/buffer.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 9f867e4f5c..c25a9789c5 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -45,6 +45,12 @@ Integer buffer_line_count(Buffer buffer, Error *err) /// Gets a buffer line /// +/// @deprecated use buffer_get_lines instead. +/// for positive indices (including 0) use +/// "buffer_get_lines(buffer, index, index+1, true)" +/// for negative indices use +/// "buffer_get_lines(buffer, index-1, index, true)" +/// /// @param buffer The buffer handle /// @param index The line index /// @param[out] err Details of an error that may have occurred @@ -67,6 +73,12 @@ String buffer_get_line(Buffer buffer, Integer index, Error *err) /// Sets a buffer line /// +/// @deprecated use buffer_set_lines instead. +/// for positive indices use +/// "buffer_set_lines(buffer, index, index+1, true, [line])" +/// for negative indices use +/// "buffer_set_lines(buffer, index-1, index, true, [line])" +/// /// @param buffer The buffer handle /// @param index The line index /// @param line The new line. @@ -81,6 +93,11 @@ void buffer_set_line(Buffer buffer, Integer index, String line, Error *err) /// Deletes a buffer line /// +/// @deprecated use buffer_set_lines instead. +/// for positive indices use +/// "buffer_set_lines(buffer, index, index+1, true, [])" +/// for negative indices use +/// "buffer_set_lines(buffer, index-1, index, true, [])" /// @param buffer The buffer handle /// @param index The line index /// @param[out] err Details of an error that may have occurred @@ -93,6 +110,10 @@ void buffer_del_line(Buffer buffer, Integer index, Error *err) /// Retrieves a line range from the buffer /// +/// @deprecated use buffer_get_lines(buffer, newstart, newend, false) +/// where newstart = start + int(not include_start) - int(start < 0) +/// newend = end + int(include_end) - int(end < 0) +/// int(bool) = 1 if bool is true else 0 /// @param buffer The buffer handle /// @param start The first line index /// @param end The last line index @@ -191,6 +212,11 @@ end: /// Replaces a line range on the buffer /// +/// @deprecated use buffer_set_lines(buffer, newstart, newend, false, lines) +/// where newstart = start + int(not include_start) + int(start < 0) +/// newend = end + int(include_end) + int(end < 0) +/// int(bool) = 1 if bool is true else 0 +/// /// @param buffer The buffer handle /// @param start The first line index /// @param end The last line index @@ -526,6 +552,8 @@ Boolean buffer_is_valid(Buffer buffer) /// Inserts a sequence of lines to a buffer at a certain index /// +/// @deprecated use buffer_set_lines(buffer, lnum, lnum, true, lines) +/// /// @param buffer The buffer handle /// @param lnum Insert the lines after `lnum`. If negative, it will append /// to the end of the buffer. |