aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-05-09 14:14:33 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-05-13 09:33:41 -0300
commitc001cfdba064a87c28fe010dbc745eddcf6dbf33 (patch)
tree6736fe3388b567211d31eb7f6bda53783ad715d4 /src
parentc1d3539fb4eeee6090d2b31aed45df06a37a6ae3 (diff)
downloadrneovim-c001cfdba064a87c28fe010dbc745eddcf6dbf33.tar.gz
rneovim-c001cfdba064a87c28fe010dbc745eddcf6dbf33.tar.bz2
rneovim-c001cfdba064a87c28fe010dbc745eddcf6dbf33.zip
API: Implement vim_get_buffer_count
Diffstat (limited to 'src')
-rw-r--r--src/api/vim.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/api/vim.c b/src/api/vim.c
index b3fef535d6..c23ac8affd 100644
--- a/src/api/vim.c
+++ b/src/api/vim.c
@@ -173,7 +173,15 @@ void vim_err_write(String str)
int64_t vim_get_buffer_count(void)
{
- abort();
+ buf_T *b = firstbuf;
+ uint64_t n = 0;
+
+ while (b) {
+ n++;
+ b = b->b_next;
+ }
+
+ return n;
}
Buffer vim_get_buffer(int64_t num, Error *err)