mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
api: call multiple methods atomically (useful in async contexts)
remove unused response_id parameter of handle_nvim_... helpers
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user