From a257f00f75b77ea3cb4e49f28ec36401eaf24f81 Mon Sep 17 00:00:00 2001 From: Viktor Kojouharov Date: Fri, 7 May 2021 15:27:38 +0200 Subject: [PATCH 1/2] Minor observational corrections to the set_extmark documentation Add a note for the line and col, saying they are 0-based. The end_col appears to be exclusive, unline the end_line. --- runtime/doc/api.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 0d85d6b539..4a275c5a6d 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -2252,14 +2252,14 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {opts}) Parameters: ~ {buffer} Buffer handle, or 0 for current buffer {ns_id} Namespace id from |nvim_create_namespace()| - {line} Line number where to place the mark - {col} Column where to place the mark + {line} Line number where to place the mark, 0-based + {col} Column where to place the mark, 0-based {opts} Optional parameters. • id : id of the extmark to edit. • end_line : ending line of the mark, 0-based inclusive. • end_col : ending col of the mark, 0-based - inclusive. + exclusive. • hl_group : name of the highlight group used to highlight this mark. • virt_text : virtual text to link to this mark. From 5ea9cbc280aec623d8c6c262c1b7ccea62d1e566 Mon Sep 17 00:00:00 2001 From: Viktor Kojouharov Date: Mon, 10 May 2021 11:27:48 +0200 Subject: [PATCH 2/2] Update the functio documentation in C --- runtime/doc/api.txt | 2 +- src/nvim/api/buffer.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 4a275c5a6d..2783640c3c 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -2252,7 +2252,7 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {opts}) Parameters: ~ {buffer} Buffer handle, or 0 for current buffer {ns_id} Namespace id from |nvim_create_namespace()| - {line} Line number where to place the mark, 0-based + {line} Line where to place the mark, 0-based {col} Column where to place the mark, 0-based {opts} Optional parameters. • id : id of the extmark to edit. diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 915b99486d..8724c83e12 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -1412,12 +1412,12 @@ 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 number where to place the mark -/// @param col Column where to place the mark +/// @param line Line where to place the mark, 0-based +/// @param col Column where to place the mark, 0-based /// @param opts Optional parameters. /// - id : id of the extmark to edit. /// - end_line : ending line of the mark, 0-based inclusive. -/// - end_col : ending col of the mark, 0-based inclusive. +/// - end_col : ending col of the mark, 0-based exclusive. /// - hl_group : name of the highlight group used to highlight /// this mark. /// - virt_text : virtual text to link to this mark.