diff options
author | ZyX <kp-pav@yandex.ru> | 2017-01-20 23:06:22 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-27 00:11:28 +0300 |
commit | 5c1b9a0d2af86461f56f0d27ed275456921f6187 (patch) | |
tree | f1516db36a75c88d6c2a2c87a586ed42c6b01563 /src/nvim/api/buffer.c | |
parent | d932693d5147ac12d181e0810a20bdcbffab2818 (diff) | |
download | rneovim-5c1b9a0d2af86461f56f0d27ed275456921f6187.tar.gz rneovim-5c1b9a0d2af86461f56f0d27ed275456921f6187.tar.bz2 rneovim-5c1b9a0d2af86461f56f0d27ed275456921f6187.zip |
api: Reserve more numbers for internal calls
Reasoning; currently INTERNAL_CALL is mostly used to determine whether it is
needed to deal with NL-used-as-NUL problem. This code is useful for nvim_… API
calls done from VimL, but not for API calls done from lua, yet lua needs to
supply something as channel_id.
Diffstat (limited to 'src/nvim/api/buffer.c')
-rw-r--r-- | src/nvim/api/buffer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index b75a2c7211..5eda88025f 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -192,7 +192,7 @@ ArrayOf(String) nvim_buf_get_lines(uint64_t channel_id, Object str = STRING_OBJ(cstr_to_string(bufstr)); // Vim represents NULs as NLs, but this may confuse clients. - if (channel_id != INTERNAL_CALL) { + if (channel_id != VIML_INTERNAL_CALL) { strchrsub(str.data.string.data, '\n', '\0'); } @@ -313,7 +313,7 @@ void nvim_buf_set_lines(uint64_t channel_id, // line and convert NULs to newlines to avoid truncation. lines[i] = xmallocz(l.size); for (size_t j = 0; j < l.size; j++) { - if (l.data[j] == '\n' && channel_id != INTERNAL_CALL) { + if (l.data[j] == '\n' && channel_id != VIML_INTERNAL_CALL) { api_set_error(err, Exception, _("string cannot contain newlines")); new_len = i + 1; goto end; |