0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -04:00

patch 7.4.1288

Problem:    ch_sendexpr() does not use JS encoding.
Solution:   Use the encoding that fits the channel mode.  Refuse using
            ch_sendexpr() on a raw channel.
This commit is contained in:
Bram Moolenaar
2016-02-07 21:59:26 +01:00
parent 74f5e65bcc
commit ae8eb3ca92
4 changed files with 36 additions and 1 deletions

View File

@@ -1514,4 +1514,17 @@ set_ref_in_channel(int copyID)
}
return abort;
}
/*
* Return the mode of channel "idx".
* If "idx" is invalid returns MODE_JSON.
*/
ch_mode_T
channel_get_mode(int idx)
{
if (idx < 0 || idx >= channel_count)
return MODE_JSON;
return channels[idx].ch_mode;
}
#endif /* FEAT_CHANNEL */