aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mark.c
diff options
context:
space:
mode:
authorJavier Lopez <graulopezjavier@gmail.com>2021-10-05 10:49:20 -0500
committerGitHub <noreply@github.com>2021-10-05 08:49:20 -0700
commit49fdc62114a5f37def3ff60ca0c4d8638903ac24 (patch)
tree8d75845ca18d9dd9c6da261473673445ab0bef27 /src/nvim/mark.c
parent912a6e5a9c58fce74134f9f8c2801373928e8289 (diff)
downloadrneovim-49fdc62114a5f37def3ff60ca0c4d8638903ac24.tar.gz
rneovim-49fdc62114a5f37def3ff60ca0c4d8638903ac24.tar.bz2
rneovim-49fdc62114a5f37def3ff60ca0c4d8638903ac24.zip
feat(api): named marks set, get, delete #15346
Adds the following API functions. - nvim_buf_set_mark(buf, name, line, col) * Set marks in a buffer. - nvim_buf_del_mark(buf, name) * Delete a mark that belongs to buffer. - nvim_del_mark(name) * Delete a global mark. - nvim_get_mark(name) * Get a global mark. Tests: - Adds test to all the new api functions, and adds more for the existing nvim_buf_get_mark. * Tests include failure cases. Documentation: - Adds documentation for all the new functions, and improves the existing fucntion docs.
Diffstat (limited to 'src/nvim/mark.c')
-rw-r--r--src/nvim/mark.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/mark.c b/src/nvim/mark.c
index b296bf39cf..edec85c0b2 100644
--- a/src/nvim/mark.c
+++ b/src/nvim/mark.c
@@ -1637,6 +1637,15 @@ void get_buf_local_marks(const buf_T *buf, list_T *l)
add_mark(l, "'>", &buf->b_visual.vi_end, buf->b_fnum, NULL);
}
+/// Get a global mark
+///
+/// @param[in] Name of named mark
+/// @param[out] Global/file mark
+xfmark_T get_global_mark(char name)
+{
+ return namedfm[mark_global_index(name)];
+}
+
/// Get information about global marks ('A' to 'Z' and '0' to '9')
///
/// @param[out] l List to store global marks