mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 07:16:09 +00:00
api: Allow blacklist functions that shouldn't be accesible from eval
Blacklist deprecated functions and functions depending on channel_id
This commit is contained in:
@@ -48,6 +48,7 @@ void remote_ui_disconnect(uint64_t channel_id)
|
||||
|
||||
void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height,
|
||||
Dictionary options, Error *err)
|
||||
FUNC_API_NOEVAL
|
||||
{
|
||||
if (pmap_has(uint64_t)(connected_uis, channel_id)) {
|
||||
api_set_error(err, Exception, _("UI already attached for channel"));
|
||||
@@ -117,6 +118,7 @@ void ui_attach(uint64_t channel_id, Integer width, Integer height,
|
||||
}
|
||||
|
||||
void nvim_ui_detach(uint64_t channel_id, Error *err)
|
||||
FUNC_API_NOEVAL
|
||||
{
|
||||
if (!pmap_has(uint64_t)(connected_uis, channel_id)) {
|
||||
api_set_error(err, Exception, _("UI is not attached for channel"));
|
||||
@@ -133,6 +135,7 @@ void ui_detach(uint64_t channel_id, Error *err)
|
||||
|
||||
void nvim_ui_try_resize(uint64_t channel_id, Integer width,
|
||||
Integer height, Error *err)
|
||||
FUNC_API_NOEVAL
|
||||
{
|
||||
if (!pmap_has(uint64_t)(connected_uis, channel_id)) {
|
||||
api_set_error(err, Exception, _("UI is not attached for channel"));
|
||||
@@ -159,7 +162,9 @@ void ui_try_resize(uint64_t channel_id, Integer width,
|
||||
}
|
||||
|
||||
void nvim_ui_set_option(uint64_t channel_id, String name,
|
||||
Object value, Error *error) {
|
||||
Object value, Error *error)
|
||||
FUNC_API_NOEVAL
|
||||
{
|
||||
if (!pmap_has(uint64_t)(connected_uis, channel_id)) {
|
||||
api_set_error(error, Exception, _("UI is not attached for channel"));
|
||||
return;
|
||||
|
Reference in New Issue
Block a user