aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/vim.c
diff options
context:
space:
mode:
authorDavid Briscoe <43559+idbrii@users.noreply.github.com>2025-02-27 02:05:00 -0800
committerGitHub <noreply@github.com>2025-02-27 02:05:00 -0800
commit6a9555c0faf3fbfc8001244ae2a19da4e92babd7 (patch)
treefa404feb289e333ea0877f89a70d2b91b963d07a /src/nvim/api/vim.c
parent746139fa1e80bbf0baa63307a0dfe2b45ce3fbd6 (diff)
downloadrneovim-6a9555c0faf3fbfc8001244ae2a19da4e92babd7.tar.gz
rneovim-6a9555c0faf3fbfc8001244ae2a19da4e92babd7.tar.bz2
rneovim-6a9555c0faf3fbfc8001244ae2a19da4e92babd7.zip
doc: clarify window-id, tab-id, nvim_set_current_x #32528
Problem: Descriptions are somewhat vague. nvim_set_current_line modifies contents but nvim_set_current_buf does not, etc. Solution: - Make it clear that these functions accept or return a winid/tabid by linking to that concept in help. - Only these few files use the term "handles", so replace them with the more conventional terminology. - Add a new help section for tab-ID. This concept is unique to neovim because vim exposes tabnr, but not tab handles. This section is modelled after `:h winid`.
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r--src/nvim/api/vim.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index 02aa73d98d..3a89e44938 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -661,7 +661,7 @@ String nvim_get_current_line(Arena *arena, Error *err)
return buffer_get_line(curbuf->handle, curwin->w_cursor.lnum - 1, arena, err);
}
-/// Sets the current line.
+/// Sets the text on the current line.
///
/// @param line Line contents
/// @param[out] err Error details, if any
@@ -823,7 +823,7 @@ Buffer nvim_get_current_buf(void)
return curbuf->handle;
}
-/// Sets the current buffer.
+/// Sets the current window's buffer to `buffer`.
///
/// @param buffer Buffer handle
/// @param[out] err Error details, if any
@@ -844,7 +844,7 @@ void nvim_set_current_buf(Buffer buffer, Error *err)
/// Gets the current list of window handles.
///
-/// @return List of window handles
+/// @return List of |window-ID|s
ArrayOf(Window) nvim_list_wins(Arena *arena)
FUNC_API_SINCE(1)
{
@@ -865,16 +865,16 @@ ArrayOf(Window) nvim_list_wins(Arena *arena)
/// Gets the current window.
///
-/// @return Window handle
+/// @return |window-ID|
Window nvim_get_current_win(void)
FUNC_API_SINCE(1)
{
return curwin->handle;
}
-/// Sets the current window.
+/// Sets the current window. Also changes tabpage, if necessary.
///
-/// @param window Window handle
+/// @param window |window-ID| to focus
/// @param[out] err Error details, if any
void nvim_set_current_win(Window window, Error *err)
FUNC_API_SINCE(1)
@@ -1106,9 +1106,9 @@ void nvim_chan_send(Integer chan, String data, Error *err)
VALIDATE(!error, "%s", error, {});
}
-/// Gets the current list of tabpage handles.
+/// Gets the current list of |tab-ID|s.
///
-/// @return List of tabpage handles
+/// @return List of |tab-ID|s
ArrayOf(Tabpage) nvim_list_tabpages(Arena *arena)
FUNC_API_SINCE(1)
{
@@ -1129,7 +1129,7 @@ ArrayOf(Tabpage) nvim_list_tabpages(Arena *arena)
/// Gets the current tabpage.
///
-/// @return Tabpage handle
+/// @return |tab-ID|
Tabpage nvim_get_current_tabpage(void)
FUNC_API_SINCE(1)
{
@@ -1138,7 +1138,7 @@ Tabpage nvim_get_current_tabpage(void)
/// Sets the current tabpage.
///
-/// @param tabpage Tabpage handle
+/// @param tabpage |tab-ID| to focus
/// @param[out] err Error details, if any
void nvim_set_current_tabpage(Tabpage tabpage, Error *err)
FUNC_API_SINCE(1)