1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
use oxi_types::{
Array,
BufHandle,
Dictionary,
Error,
Integer,
NonOwning,
Object,
String,
TabHandle,
WinHandle,
};
use crate::opts::*;
extern "C" {
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1037
pub(crate) fn nvim_chan_send(
chan: Integer,
data: NonOwning<String>,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L888
pub(crate) fn nvim_create_buf(
listed: bool,
scratch: bool,
err: *mut Error,
) -> BufHandle;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/command.c#L938
pub(crate) fn nvim_create_user_command(
#[cfg(not(feature = "neovim-0-8"))] channel_id: u64,
name: NonOwning<String>,
command: NonOwning<Object>,
opts: *const CreateCommandOpts,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L623
pub(crate) fn nvim_del_current_line(err: *mut Error);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1446
pub(crate) fn nvim_del_keymap(
channel_id: u64,
mode: NonOwning<String>,
lhs: NonOwning<String>,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1958
pub(crate) fn nvim_del_mark(
name: NonOwning<String>,
err: *mut Error,
) -> bool;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/command.c#L949
pub(crate) fn nvim_del_user_command(
name: NonOwning<String>,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L667
pub(crate) fn nvim_del_var(name: NonOwning<String>, err: *mut Error);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L705
pub(crate) fn nvim_echo(
chunks: NonOwning<Array>,
history: bool,
opts: NonOwning<Dictionary>,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L749
pub(crate) fn nvim_err_write(str: NonOwning<String>);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L760
pub(crate) fn nvim_err_writeln(str: NonOwning<String>);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L2070
pub(crate) fn nvim_eval_statusline(
str: NonOwning<String>,
opts: *const EvalStatuslineOpts,
err: *mut Error,
) -> Dictionary;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L226
pub(crate) fn nvim_feedkeys(
keys: NonOwning<String>,
mode: NonOwning<String>,
escape_ks: bool,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/options.c#L289
pub(crate) fn nvim_get_all_options_info(err: *mut Error) -> Dictionary;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1567
pub(crate) fn nvim_get_chan_info(
chan: Integer,
err: *mut Error,
) -> Dictionary;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1275
pub(crate) fn nvim_get_color_by_name(name: NonOwning<String>) -> Integer;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1288
pub(crate) fn nvim_get_color_map() -> Dictionary;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/command.c#L1230
pub(crate) fn nvim_get_commands(
opts: *const GetCommandsOpts,
error: *mut Error,
) -> Dictionary;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1308
pub(crate) fn nvim_get_context(
opts: *const GetContextOpts,
error: *mut Error,
) -> Dictionary;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L794
pub(crate) fn nvim_get_current_buf() -> BufHandle;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L603
pub(crate) fn nvim_get_current_line(err: *mut Error) -> String;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1075
pub(crate) fn nvim_get_current_tabpage() -> TabHandle;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L849
pub(crate) fn nvim_get_current_win() -> WinHandle;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/deprecated.c#L188
pub(crate) fn nvim_get_hl_by_id(
hl_id: Integer,
rgb: bool,
arena: *mut core::ffi::c_void,
error: *mut Error,
) -> Dictionary;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/deprecated.c#L209
pub(crate) fn nvim_get_hl_by_name(
name: NonOwning<String>,
rgb: bool,
arena: *mut core::ffi::c_void,
error: *mut Error,
) -> Dictionary;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L82
pub(crate) fn nvim_get_hl_id_by_name(name: NonOwning<String>) -> Integer;
// https://github.com/neovim/neovim/blob/v0.8.3/src/nvim/api/vim.c#L1397
pub(crate) fn nvim_get_keymap(mode: NonOwning<String>) -> Array;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1987
pub(crate) fn nvim_get_mark(
name: NonOwning<String>,
#[cfg(any(feature = "neovim-0-8", feature = "neovim-0-9"))]
opts: NonOwning<Dictionary>,
#[cfg(feature = "neovim-nightly")] opts: *const GetMarkOpts,
err: *mut Error,
) -> Array;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1378
pub(crate) fn nvim_get_mode() -> Dictionary;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/options.c#L361
pub(crate) fn nvim_get_option(
name: NonOwning<String>,
#[cfg(not(feature = "neovim-0-8"))] arena: *mut core::ffi::c_void,
err: *mut Error,
) -> Object;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/deprecated.c#L520
pub(crate) fn nvim_get_option_info(
name: NonOwning<String>,
err: *mut Error,
) -> Dictionary;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/options.c#L146
pub(crate) fn nvim_get_option_value(
name: NonOwning<String>,
opts: *const OptionValueOpts,
err: *mut Error,
) -> Object;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1842
pub(crate) fn nvim_get_proc(pid: Integer, err: *mut Error) -> Object;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1802
pub(crate) fn nvim_get_proc_children(
pid: Integer,
err: *mut Error,
) -> Array;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L516
pub(crate) fn nvim_get_runtime_file(
name: NonOwning<String>,
all: bool,
err: *mut Error,
) -> Array;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L635
pub(crate) fn nvim_get_var(
name: NonOwning<String>,
err: *mut Error,
) -> Object;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L678
pub(crate) fn nvim_get_vvar(
name: NonOwning<String>,
err: *mut Error,
) -> Object;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L305
pub(crate) fn nvim_input(keys: NonOwning<String>) -> Integer;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L333
pub(crate) fn nvim_input_mouse(
button: NonOwning<String>,
action: NonOwning<String>,
modifier: NonOwning<String>,
grid: Integer,
row: Integer,
col: Integer,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L772
pub(crate) fn nvim_list_bufs() -> Array;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1580
pub(crate) fn nvim_list_chans() -> Array;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L493
pub(crate) fn nvim_list_runtime_paths(err: *mut Error) -> Array;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1053
pub(crate) fn nvim_list_tabpages() -> Array;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1793
pub(crate) fn nvim_list_uis() -> Array;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L827
pub(crate) fn nvim_list_wins() -> Array;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1355
pub(crate) fn nvim_load_context(dict: NonOwning<Dictionary>) -> Object;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L463
pub(crate) fn nvim_notify(
msg: NonOwning<String>,
log_level: Integer,
opts: NonOwning<Dictionary>,
err: *mut Error,
) -> Object;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L952
pub(crate) fn nvim_open_term(
buf: BufHandle,
#[cfg(any(feature = "neovim-0-8", feature = "neovim-0-9"))]
opts: NonOwning<Dictionary>,
#[cfg(feature = "neovim-nightly")] opts: *const OpenTermOpts,
err: *mut Error,
) -> Integer;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L739
pub(crate) fn nvim_out_write(str: NonOwning<String>);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1127
pub(crate) fn nvim_paste(
data: NonOwning<String>,
crlf: bool,
phase: Integer,
err: *mut Error,
) -> bool;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1198
pub(crate) fn nvim_put(
lines: NonOwning<Array>,
r#type: NonOwning<String>,
after: bool,
follow: bool,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L411
pub(crate) fn nvim_replace_termcodes(
str: NonOwning<String>,
from_part: bool,
do_lt: bool,
special: bool,
) -> String;
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1890
pub(crate) fn nvim_select_popupmenu_item(
item: Integer,
insert: bool,
finish: bool,
#[cfg(any(feature = "neovim-0-8", feature = "neovim-0-9"))]
opts: NonOwning<Dictionary>,
#[cfg(feature = "neovim-nightly")]
opts: *const SelectPopupMenuItemOpts,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L804
pub(crate) fn nvim_set_current_buf(buffer: BufHandle, err: *mut Error);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L576
pub(crate) fn nvim_set_current_dir(
dir: NonOwning<String>,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L613
pub(crate) fn nvim_set_current_line(
line: NonOwning<String>,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1085
pub(crate) fn nvim_set_current_tabpage(
tabpage: TabHandle,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L859
pub(crate) fn nvim_set_current_win(window: WinHandle, err: *mut Error);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L156
pub(crate) fn nvim_set_hl(
ns_id: Integer,
name: NonOwning<String>,
val: *const SetHighlightOpts,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L1434
pub(crate) fn nvim_set_keymap(
channel_id: u64,
mode: NonOwning<String>,
lhs: NonOwning<String>,
rhs: NonOwning<String>,
opts: *const SetKeymapOpts,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/options.c#L350
pub(crate) fn nvim_set_option(
channel_id: u64,
name: NonOwning<String>,
value: NonOwning<Object>,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/options.c#L232
pub(crate) fn nvim_set_option_value(
#[cfg(any(feature = "neovim-0-9", feature = "neovim-nightly"))]
channel_id: u64,
name: NonOwning<String>,
value: NonOwning<Object>,
opts: *const OptionValueOpts,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L657
pub(crate) fn nvim_set_var(
name: NonOwning<String>,
value: NonOwning<Object>,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L689
pub(crate) fn nvim_set_vvar(
name: NonOwning<String>,
value: NonOwning<Object>,
err: *mut Error,
);
// https://github.com/neovim/neovim/blob/v0.9.0/src/nvim/api/vim.c#L480
pub(crate) fn nvim_strwidth(
text: NonOwning<String>,
err: *mut Error,
) -> Integer;
}