api: call multiple methods atomically (useful in async contexts)

remove unused response_id parameter of handle_nvim_... helpers
This commit is contained in:
Björn Linse
2016-04-13 16:37:09 +02:00
parent 9d4fcec7c6
commit f6968dc0f7
9 changed files with 184 additions and 10 deletions

View File

@@ -191,7 +191,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 != INVALID_CHANNEL) {
if (channel_id != INTERNAL_CALL) {
strchrsub(str.data.string.data, '\n', '\0');
}
@@ -312,7 +312,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 != INVALID_CHANNEL) {
if (l.data[j] == '\n' && channel_id != INTERNAL_CALL) {
api_set_error(err, Exception, _("string cannot contain newlines"));
new_len = i + 1;
goto end;