aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/buffer.c
diff options
context:
space:
mode:
authorKillTheMule <KillTheMule@users.noreply.github.com>2019-05-24 18:07:16 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-05-26 16:15:20 +0200
commit52215f57526f27c7752685ae280865ae71105969 (patch)
tree0dfbfe440bead79a426390a3933039c15dfd01fc /src/nvim/api/buffer.c
parent55419a6904306c21e6537a3b891df761ac352540 (diff)
downloadrneovim-52215f57526f27c7752685ae280865ae71105969.tar.gz
rneovim-52215f57526f27c7752685ae280865ae71105969.tar.bz2
rneovim-52215f57526f27c7752685ae280865ae71105969.zip
doc/API: document indexing behavior #10058
close #10058
Diffstat (limited to 'src/nvim/api/buffer.c')
-rw-r--r--src/nvim/api/buffer.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index 9a5ffecad4..06d7c1810c 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -487,7 +487,7 @@ end:
try_end(err);
}
-/// Returns the byte offset for a line.
+/// Returns the byte offset of a line (0-indexed). |api-indexing|
///
/// Line 1 (index=0) has offset 0. UTF-8 bytes are counted. EOL is one byte.
/// 'fileformat' and 'fileencoding' are ignored. The line index just after the
@@ -879,7 +879,9 @@ void buffer_insert(Buffer buffer,
nvim_buf_set_lines(0, buffer, lnum, lnum, true, lines, err);
}
-/// Return a tuple (row,col) representing the position of the named mark
+/// Return a tuple (row,col) representing the position of the named mark.
+///
+/// Marks are (1,0)-indexed. |api-indexing|
///
/// @param buffer Buffer handle, or 0 for current buffer
/// @param name Mark name
@@ -993,8 +995,8 @@ Integer nvim_buf_add_highlight(Buffer buffer,
/// Clears namespaced objects, highlights and virtual text, from a line range
///
-/// To clear the namespace in the entire buffer, pass in 0 and -1 to
-/// line_start and line_end respectively.
+/// Lines are 0-indexed. |api-indexing| To clear the namespace in the entire
+/// buffer, specify line_start=0 and line_end=-1.
///
/// @param buffer Buffer handle, or 0 for current buffer
/// @param ns_id Namespace to clear, or -1 to clear all namespaces.