From 1156360fe724fd3242186ededd8b3d4a42c990cd Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Fri, 23 May 2014 15:49:46 -0300 Subject: API: Refactor: Implement buffer_get_number --- src/nvim/api/buffer.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/nvim/api/buffer.c') diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 9a4285d74c..0796f5a324 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -293,6 +293,18 @@ void buffer_set_option(Buffer buffer, String name, Object value, Error *err) set_option_to(buf, SREQ_BUF, name, value, err); } +Integer buffer_get_number(Buffer buffer, Error *err) +{ + Integer rv = 0; + buf_T *buf = find_buffer(buffer, err); + + if (!buf) { + return rv; + } + + return buf->b_fnum; +} + String buffer_get_name(Buffer buffer, Error *err) { String rv = {.size = 0, .data = ""}; -- cgit