mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 07:28:34 +00:00

committed by
Justin M. Keyes

parent
10e885bdfc
commit
643ef257b3
@@ -505,6 +505,11 @@ end:
|
||||
static void unsubscribe(Channel *channel, char *event)
|
||||
{
|
||||
char *event_string = pmap_get(cstr_t)(event_strings, event);
|
||||
if (!event_string) {
|
||||
WLOG("RPC: ch %" PRIu64 ": tried to unsubscribe unknown event '%s'",
|
||||
channel->id, event);
|
||||
return;
|
||||
}
|
||||
pmap_del(cstr_t)(channel->rpc.subscribed_events, event_string);
|
||||
|
||||
map_foreach_value(channels, channel, {
|
||||
|
@@ -65,4 +65,11 @@ describe('notify', function()
|
||||
eq(nest_level, act_nest_level)
|
||||
end)
|
||||
end)
|
||||
|
||||
it('unsubscribe non-existing event #8745', function()
|
||||
nvim('subscribe', 'event1')
|
||||
nvim('unsubscribe', 'doesnotexist')
|
||||
nvim('unsubscribe', 'event1')
|
||||
eq(2, eval('1+1')) -- Still alive?
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user