Merge branch 'master' into expression-parser

This commit is contained in:
ZyX
2017-11-26 15:54:03 +03:00
75 changed files with 2765 additions and 1488 deletions

View File

@@ -12,6 +12,7 @@
#include "nvim/api/private/handle.h"
#include "nvim/msgpack_rpc/helpers.h"
#include "nvim/ascii.h"
#include "nvim/assert.h"
#include "nvim/vim.h"
#include "nvim/buffer.h"
#include "nvim/window.h"
@@ -760,12 +761,8 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err)
case kObjectTypeWindow:
case kObjectTypeTabpage:
case kObjectTypeInteger:
if (obj.data.integer > VARNUMBER_MAX
|| obj.data.integer < VARNUMBER_MIN) {
api_set_error(err, kErrorTypeValidation, "Integer value outside range");
return false;
}
STATIC_ASSERT(sizeof(obj.data.integer) <= sizeof(varnumber_T),
"Integer size must be <= VimL number size");
tv->v_type = VAR_NUMBER;
tv->vval.v_number = (varnumber_T)obj.data.integer;
break;

View File

@@ -252,7 +252,7 @@ static void remote_ui_flush(UI *ui)
{
UIData *data = ui->data;
if (data->buffer.size > 0) {
channel_send_event(data->channel_id, "redraw", data->buffer);
rpc_send_event(data->channel_id, "redraw", data->buffer);
data->buffer = (Array)ARRAY_DICT_INIT;
}
}

View File

@@ -723,7 +723,7 @@ void nvim_subscribe(uint64_t channel_id, String event)
char e[METHOD_MAXLEN + 1];
memcpy(e, event.data, length);
e[length] = NUL;
channel_subscribe(channel_id, e);
rpc_subscribe(channel_id, e);
}
/// Unsubscribes to event broadcasts
@@ -739,7 +739,7 @@ void nvim_unsubscribe(uint64_t channel_id, String event)
char e[METHOD_MAXLEN + 1];
memcpy(e, event.data, length);
e[length] = NUL;
channel_unsubscribe(channel_id, e);
rpc_unsubscribe(channel_id, e);
}
Integer nvim_get_color_by_name(String name)