aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/buffer.c
diff options
context:
space:
mode:
authorPatrice Peterson <patrice.peterson@mailbox.org>2021-09-10 17:41:51 -0700
committerJustin M. Keyes <justinkz@gmail.com>2021-09-10 17:59:28 -0700
commit9b553ad28df74f0a0c5f20a96ab1248c8724b1c1 (patch)
treee24479ae95fdd7882523c5d4b014e78696e961f9 /src/nvim/api/buffer.c
parent9697023a0be2511f9e9be59a73afe3a2d5b7bf23 (diff)
downloadrneovim-9b553ad28df74f0a0c5f20a96ab1248c8724b1c1.tar.gz
rneovim-9b553ad28df74f0a0c5f20a96ab1248c8724b1c1.tar.bz2
rneovim-9b553ad28df74f0a0c5f20a96ab1248c8724b1c1.zip
docs: extmark indexing #12742
Extmarks mostly use api-indexing, except for nvim_buf_get_extmarks(), which uses api-indexing with inclusive ranges. ref #11456
Diffstat (limited to 'src/nvim/api/buffer.c')
-rw-r--r--src/nvim/api/buffer.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index 878ffdf06f..3260c083b8 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -1232,7 +1232,7 @@ static Array extmark_to_array(ExtmarkInfo extmark, bool id, bool add_dict)
return rv;
}
-/// Returns position for a given extmark id
+/// Gets the position (0-indexed) of an extmark {id}.
///
/// @param buffer Buffer handle, or 0 for current buffer
/// @param ns_id Namespace id from |nvim_create_namespace()|
@@ -1240,7 +1240,8 @@ static Array extmark_to_array(ExtmarkInfo extmark, bool id, bool add_dict)
/// @param opts Optional parameters. Keys:
/// - details: Whether to include the details dict
/// @param[out] err Error details, if any
-/// @return (row, col) tuple or empty list () if extmark id was absent
+/// @return 0-indexed (row, col) tuple or empty list () if extmark id was
+/// absent
ArrayOf(Integer) nvim_buf_get_extmark_by_id(Buffer buffer, Integer ns_id,
Integer id, Dictionary opts,
Error *err)
@@ -1320,10 +1321,10 @@ ArrayOf(Integer) nvim_buf_get_extmark_by_id(Buffer buffer, Integer ns_id,
///
/// @param buffer Buffer handle, or 0 for current buffer
/// @param ns_id Namespace id from |nvim_create_namespace()|
-/// @param start Start of range, given as (row, col) or valid extmark id
-/// (whose position defines the bound)
-/// @param end End of range, given as (row, col) or valid extmark id
-/// (whose position defines the bound)
+/// @param start Start of range, given as 0-indexed (row, col) or valid
+/// extmark id (whose position defines the bound)
+/// @param end End of range (inclusive), given as 0-indexed (row, col) or
+/// valid extmark id (whose position defines the bound)
/// @param opts Optional parameters. Keys:
/// - limit: Maximum number of marks to return
/// - details Whether to include the details dict
@@ -1424,8 +1425,8 @@ Array nvim_buf_get_extmarks(Buffer buffer, Integer ns_id,
///
/// @param buffer Buffer handle, or 0 for current buffer
/// @param ns_id Namespace id from |nvim_create_namespace()|
-/// @param line Line where to place the mark, 0-based
-/// @param col Column where to place the mark, 0-based
+/// @param line Line where to place the mark, 0-based. |api-indexing|
+/// @param col Column where to place the mark, 0-based. |api-indexing|
/// @param opts Optional parameters.
/// - id : id of the extmark to edit.
/// - end_line : ending line of the mark, 0-based inclusive.