aboutsummaryrefslogtreecommitdiff
path: root/src/api/buffer.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-05-10 12:42:12 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-05-13 09:33:41 -0300
commit417a61f54f6ca9b05454bae4c5dc6c2c8ff2d6af (patch)
tree750b949d46d942755fb82cab0d6827e73e648931 /src/api/buffer.c
parent73dbb97f8e51c77bb553a8af645b728543462d26 (diff)
downloadrneovim-417a61f54f6ca9b05454bae4c5dc6c2c8ff2d6af.tar.gz
rneovim-417a61f54f6ca9b05454bae4c5dc6c2c8ff2d6af.tar.bz2
rneovim-417a61f54f6ca9b05454bae4c5dc6c2c8ff2d6af.zip
API: Implement buffer_get_length
Diffstat (limited to 'src/api/buffer.c')
-rw-r--r--src/api/buffer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/api/buffer.c b/src/api/buffer.c
index d5b46943da..cb82714a34 100644
--- a/src/api/buffer.c
+++ b/src/api/buffer.c
@@ -37,7 +37,13 @@ static int64_t normalize_index(buf_T *buf, int64_t index);
int64_t buffer_get_length(Buffer buffer, Error *err)
{
- abort();
+ buf_T *buf = find_buffer(buffer, err);
+
+ if (!buf) {
+ return 0;
+ }
+
+ return buf->b_ml.ml_line_count;
}
String buffer_get_line(Buffer buffer, int64_t index, Error *err)