neovim 0.9.0.pre.1 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/neovim/client.rb CHANGED
@@ -9,7 +9,7 @@ module Neovim
9
9
  # +RemoteObject+ subclasses (i.e. +Buffer+, +Window+, or +Tabpage+),
10
10
  # which similarly have dynamically generated interfaces.
11
11
  #
12
- # The methods documented here were generated using NVIM v0.4.4
12
+ # The methods documented here were generated using NVIM v0.9.1
13
13
  #
14
14
  # @see Buffer
15
15
  # @see Window
@@ -117,6 +117,155 @@ module Neovim
117
117
 
118
118
  # The following methods are dynamically generated.
119
119
  =begin
120
+ @method get_autocmds(opts)
121
+ See +:h nvim_get_autocmds()+
122
+ @param [Hash] opts
123
+ @return [Array]
124
+
125
+ @method create_autocmd(event, opts)
126
+ See +:h nvim_create_autocmd()+
127
+ @param [Object] event
128
+ @param [Hash] opts
129
+ @return [Integer]
130
+
131
+ @method del_autocmd(id)
132
+ See +:h nvim_del_autocmd()+
133
+ @param [Integer] id
134
+ @return [void]
135
+
136
+ @method clear_autocmds(opts)
137
+ See +:h nvim_clear_autocmds()+
138
+ @param [Hash] opts
139
+ @return [void]
140
+
141
+ @method create_augroup(name, opts)
142
+ See +:h nvim_create_augroup()+
143
+ @param [String] name
144
+ @param [Hash] opts
145
+ @return [Integer]
146
+
147
+ @method del_augroup_by_id(id)
148
+ See +:h nvim_del_augroup_by_id()+
149
+ @param [Integer] id
150
+ @return [void]
151
+
152
+ @method del_augroup_by_name(name)
153
+ See +:h nvim_del_augroup_by_name()+
154
+ @param [String] name
155
+ @return [void]
156
+
157
+ @method exec_autocmds(event, opts)
158
+ See +:h nvim_exec_autocmds()+
159
+ @param [Object] event
160
+ @param [Hash] opts
161
+ @return [void]
162
+
163
+ @method parse_cmd(str, opts)
164
+ See +:h nvim_parse_cmd()+
165
+ @param [String] str
166
+ @param [Hash] opts
167
+ @return [Hash]
168
+
169
+ @method cmd(cmd, opts)
170
+ See +:h nvim_cmd()+
171
+ @param [Hash] cmd
172
+ @param [Hash] opts
173
+ @return [String]
174
+
175
+ @method create_user_command(name, command, opts)
176
+ See +:h nvim_create_user_command()+
177
+ @param [String] name
178
+ @param [Object] command
179
+ @param [Hash] opts
180
+ @return [void]
181
+
182
+ @method del_user_command(name)
183
+ See +:h nvim_del_user_command()+
184
+ @param [String] name
185
+ @return [void]
186
+
187
+ @method get_commands(opts)
188
+ See +:h nvim_get_commands()+
189
+ @param [Hash] opts
190
+ @return [Hash]
191
+
192
+ @method exec(src, output)
193
+ See +:h nvim_exec()+
194
+ @param [String] src
195
+ @param [Boolean] output
196
+ @return [String]
197
+
198
+ @method command_output(command)
199
+ See +:h nvim_command_output()+
200
+ @param [String] command
201
+ @return [String]
202
+
203
+ @method execute_lua(code, args)
204
+ See +:h nvim_execute_lua()+
205
+ @param [String] code
206
+ @param [Array] args
207
+ @return [Object]
208
+
209
+ @method get_hl_by_id(hl_id, rgb)
210
+ See +:h nvim_get_hl_by_id()+
211
+ @param [Integer] hl_id
212
+ @param [Boolean] rgb
213
+ @return [Hash]
214
+
215
+ @method get_hl_by_name(name, rgb)
216
+ See +:h nvim_get_hl_by_name()+
217
+ @param [String] name
218
+ @param [Boolean] rgb
219
+ @return [Hash]
220
+
221
+ @method get_option_info(name)
222
+ See +:h nvim_get_option_info()+
223
+ @param [String] name
224
+ @return [Hash]
225
+
226
+ @method create_namespace(name)
227
+ See +:h nvim_create_namespace()+
228
+ @param [String] name
229
+ @return [Integer]
230
+
231
+ @method get_namespaces
232
+ See +:h nvim_get_namespaces()+
233
+ @return [Hash]
234
+
235
+ @method set_decoration_provider(ns_id, opts)
236
+ See +:h nvim_set_decoration_provider()+
237
+ @param [Integer] ns_id
238
+ @param [Hash] opts
239
+ @return [void]
240
+
241
+ @method get_option_value(name, opts)
242
+ See +:h nvim_get_option_value()+
243
+ @param [String] name
244
+ @param [Hash] opts
245
+ @return [Object]
246
+
247
+ @method set_option_value(name, value, opts)
248
+ See +:h nvim_set_option_value()+
249
+ @param [String] name
250
+ @param [Object] value
251
+ @param [Hash] opts
252
+ @return [void]
253
+
254
+ @method get_all_options_info
255
+ See +:h nvim_get_all_options_info()+
256
+ @return [Hash]
257
+
258
+ @method get_option_info2(name, opts)
259
+ See +:h nvim_get_option_info2()+
260
+ @param [String] name
261
+ @param [Hash] opts
262
+ @return [Hash]
263
+
264
+ @method get_option(name)
265
+ See +:h nvim_get_option()+
266
+ @param [String] name
267
+ @return [Object]
268
+
120
269
  @method ui_attach(width, height, options)
121
270
  See +:h nvim_ui_attach()+
122
271
  @param [Integer] width
@@ -124,6 +273,11 @@ module Neovim
124
273
  @param [Hash] options
125
274
  @return [void]
126
275
 
276
+ @method ui_set_focus(gained)
277
+ See +:h nvim_ui_set_focus()+
278
+ @param [Boolean] gained
279
+ @return [void]
280
+
127
281
  @method ui_detach
128
282
  See +:h nvim_ui_detach()+
129
283
  @return [void]
@@ -152,28 +306,47 @@ module Neovim
152
306
  @param [Integer] height
153
307
  @return [void]
154
308
 
155
- @method command(command)
156
- See +:h nvim_command()+
157
- @param [String] command
309
+ @method ui_pum_set_bounds(width, height, row, col)
310
+ See +:h nvim_ui_pum_set_bounds()+
311
+ @param [Float] width
312
+ @param [Float] height
313
+ @param [Float] row
314
+ @param [Float] col
158
315
  @return [void]
159
316
 
160
- @method get_hl_by_name(name, rgb)
161
- See +:h nvim_get_hl_by_name()+
317
+ @method get_hl_id_by_name(name)
318
+ See +:h nvim_get_hl_id_by_name()+
162
319
  @param [String] name
163
- @param [Boolean] rgb
164
- @return [Hash]
320
+ @return [Integer]
165
321
 
166
- @method get_hl_by_id(hl_id, rgb)
167
- See +:h nvim_get_hl_by_id()+
168
- @param [Integer] hl_id
169
- @param [Boolean] rgb
322
+ @method get_hl(ns_id, opts)
323
+ See +:h nvim_get_hl()+
324
+ @param [Integer] ns_id
325
+ @param [Hash] opts
170
326
  @return [Hash]
171
327
 
172
- @method feedkeys(keys, mode, escape_csi)
328
+ @method set_hl(ns_id, name, val)
329
+ See +:h nvim_set_hl()+
330
+ @param [Integer] ns_id
331
+ @param [String] name
332
+ @param [Hash] val
333
+ @return [void]
334
+
335
+ @method set_hl_ns(ns_id)
336
+ See +:h nvim_set_hl_ns()+
337
+ @param [Integer] ns_id
338
+ @return [void]
339
+
340
+ @method set_hl_ns_fast(ns_id)
341
+ See +:h nvim_set_hl_ns_fast()+
342
+ @param [Integer] ns_id
343
+ @return [void]
344
+
345
+ @method feedkeys(keys, mode, escape_ks)
173
346
  See +:h nvim_feedkeys()+
174
347
  @param [String] keys
175
348
  @param [String] mode
176
- @param [Boolean] escape_csi
349
+ @param [Boolean] escape_ks
177
350
  @return [void]
178
351
 
179
352
  @method input(keys)
@@ -199,33 +372,17 @@ module Neovim
199
372
  @param [Boolean] special
200
373
  @return [String]
201
374
 
202
- @method command_output(command)
203
- See +:h nvim_command_output()+
204
- @param [String] command
205
- @return [String]
206
-
207
- @method eval(expr)
208
- See +:h nvim_eval()+
209
- @param [String] expr
210
- @return [Object]
211
-
212
- @method execute_lua(code, args)
213
- See +:h nvim_execute_lua()+
375
+ @method exec_lua(code, args)
376
+ See +:h nvim_exec_lua()+
214
377
  @param [String] code
215
378
  @param [Array] args
216
379
  @return [Object]
217
380
 
218
- @method call_function(fn, args)
219
- See +:h nvim_call_function()+
220
- @param [String] fn
221
- @param [Array] args
222
- @return [Object]
223
-
224
- @method call_dict_function(dict, fn, args)
225
- See +:h nvim_call_dict_function()+
226
- @param [Object] dict
227
- @param [String] fn
228
- @param [Array] args
381
+ @method notify(msg, log_level, opts)
382
+ See +:h nvim_notify()+
383
+ @param [String] msg
384
+ @param [Integer] log_level
385
+ @param [Hash] opts
229
386
  @return [Object]
230
387
 
231
388
  @method strwidth(text)
@@ -237,6 +394,12 @@ module Neovim
237
394
  See +:h nvim_list_runtime_paths()+
238
395
  @return [Array<String>]
239
396
 
397
+ @method get_runtime_file(name, all)
398
+ See +:h nvim_get_runtime_file()+
399
+ @param [String] name
400
+ @param [Boolean] all
401
+ @return [Array<String>]
402
+
240
403
  @method set_current_dir(dir)
241
404
  See +:h nvim_set_current_dir()+
242
405
  @param [String] dir
@@ -282,10 +445,12 @@ module Neovim
282
445
  @param [Object] value
283
446
  @return [void]
284
447
 
285
- @method get_option(name)
286
- See +:h nvim_get_option()+
287
- @param [String] name
288
- @return [Object]
448
+ @method echo(chunks, history, opts)
449
+ See +:h nvim_echo()+
450
+ @param [Array] chunks
451
+ @param [Boolean] history
452
+ @param [Hash] opts
453
+ @return [void]
289
454
 
290
455
  @method out_write(str)
291
456
  See +:h nvim_out_write()+
@@ -334,12 +499,17 @@ module Neovim
334
499
  @param [Boolean] scratch
335
500
  @return [Buffer]
336
501
 
337
- @method open_win(buffer, enter, config)
338
- See +:h nvim_open_win()+
502
+ @method open_term(buffer, opts)
503
+ See +:h nvim_open_term()+
339
504
  @param [Buffer] buffer
340
- @param [Boolean] enter
341
- @param [Hash] config
342
- @return [Window]
505
+ @param [Hash] opts
506
+ @return [Integer]
507
+
508
+ @method chan_send(chan, data)
509
+ See +:h nvim_chan_send()+
510
+ @param [Integer] chan
511
+ @param [String] data
512
+ @return [void]
343
513
 
344
514
  @method list_tabpages
345
515
  See +:h nvim_list_tabpages()+
@@ -354,15 +524,6 @@ module Neovim
354
524
  @param [Tabpage] tabpage
355
525
  @return [void]
356
526
 
357
- @method create_namespace(name)
358
- See +:h nvim_create_namespace()+
359
- @param [String] name
360
- @return [Integer]
361
-
362
- @method get_namespaces
363
- See +:h nvim_get_namespaces()+
364
- @return [Hash]
365
-
366
527
  @method paste(data, crlf, phase)
367
528
  See +:h nvim_paste()+
368
529
  @param [String] data
@@ -430,11 +591,6 @@ module Neovim
430
591
  @param [String] lhs
431
592
  @return [void]
432
593
 
433
- @method get_commands(opts)
434
- See +:h nvim_get_commands()+
435
- @param [Hash] opts
436
- @return [Hash]
437
-
438
594
  @method get_api_info
439
595
  See +:h nvim_get_api_info()+
440
596
  @return [Array]
@@ -462,13 +618,6 @@ module Neovim
462
618
  @param [Array] calls
463
619
  @return [Array]
464
620
 
465
- @method parse_expression(expr, flags, highlight)
466
- See +:h nvim_parse_expression()+
467
- @param [String] expr
468
- @param [String] flags
469
- @param [Boolean] highlight
470
- @return [Hash]
471
-
472
621
  @method list_uis
473
622
  See +:h nvim_list_uis()+
474
623
  @return [Array]
@@ -491,6 +640,66 @@ module Neovim
491
640
  @param [Hash] opts
492
641
  @return [void]
493
642
 
643
+ @method del_mark(name)
644
+ See +:h nvim_del_mark()+
645
+ @param [String] name
646
+ @return [Boolean]
647
+
648
+ @method get_mark(name, opts)
649
+ See +:h nvim_get_mark()+
650
+ @param [String] name
651
+ @param [Hash] opts
652
+ @return [Array]
653
+
654
+ @method eval_statusline(str, opts)
655
+ See +:h nvim_eval_statusline()+
656
+ @param [String] str
657
+ @param [Hash] opts
658
+ @return [Hash]
659
+
660
+ @method exec2(src, opts)
661
+ See +:h nvim_exec2()+
662
+ @param [String] src
663
+ @param [Hash] opts
664
+ @return [Hash]
665
+
666
+ @method command(command)
667
+ See +:h nvim_command()+
668
+ @param [String] command
669
+ @return [void]
670
+
671
+ @method eval(expr)
672
+ See +:h nvim_eval()+
673
+ @param [String] expr
674
+ @return [Object]
675
+
676
+ @method call_function(fn, args)
677
+ See +:h nvim_call_function()+
678
+ @param [String] fn
679
+ @param [Array] args
680
+ @return [Object]
681
+
682
+ @method call_dict_function(dict, fn, args)
683
+ See +:h nvim_call_dict_function()+
684
+ @param [Object] dict
685
+ @param [String] fn
686
+ @param [Array] args
687
+ @return [Object]
688
+
689
+ @method parse_expression(expr, flags, highlight)
690
+ See +:h nvim_parse_expression()+
691
+ @param [String] expr
692
+ @param [String] flags
693
+ @param [Boolean] highlight
694
+ @return [Hash]
695
+
696
+ @method open_win(buffer, enter, config)
697
+ See +:h nvim_open_win()+
698
+ @param [Buffer] buffer
699
+ @param [Boolean] enter
700
+ @param [Hash] config
701
+ @return [Window]
702
+
494
703
  =end
495
704
  end
496
705
  end
@@ -3,7 +3,7 @@ require "neovim/remote_object"
3
3
  module Neovim
4
4
  # Class representing an +nvim+ tabpage.
5
5
  #
6
- # The methods documented here were generated using NVIM v0.4.4
6
+ # The methods documented here were generated using NVIM v0.9.1
7
7
  class Tabpage < RemoteObject
8
8
  # The following methods are dynamically generated.
9
9
  =begin
@@ -1,3 +1,3 @@
1
1
  module Neovim
2
- VERSION = Gem::Version.new("0.9.0.pre.1")
2
+ VERSION = Gem::Version.new("0.9.1")
3
3
  end
data/lib/neovim/window.rb CHANGED
@@ -3,7 +3,7 @@ require "neovim/remote_object"
3
3
  module Neovim
4
4
  # Class representing an +nvim+ window.
5
5
  #
6
- # The methods documented here were generated using NVIM v0.4.4
6
+ # The methods documented here were generated using NVIM v0.9.1
7
7
  class Window < RemoteObject
8
8
  # Get the buffer displayed in the window
9
9
  #
@@ -64,6 +64,26 @@ module Neovim
64
64
 
65
65
  # The following methods are dynamically generated.
66
66
  =begin
67
+ @method get_option(name)
68
+ See +:h nvim_win_get_option()+
69
+ @param [String] name
70
+ @return [Object]
71
+
72
+ @method set_option(name, value)
73
+ See +:h nvim_win_set_option()+
74
+ @param [String] name
75
+ @param [Object] value
76
+ @return [void]
77
+
78
+ @method set_config(config)
79
+ See +:h nvim_win_set_config()+
80
+ @param [Hash] config
81
+ @return [void]
82
+
83
+ @method get_config
84
+ See +:h nvim_win_get_config()+
85
+ @return [Hash]
86
+
67
87
  @method get_buf
68
88
  See +:h nvim_win_get_buf()+
69
89
  @return [Buffer]
@@ -116,17 +136,6 @@ module Neovim
116
136
  @param [String] name
117
137
  @return [void]
118
138
 
119
- @method get_option(name)
120
- See +:h nvim_win_get_option()+
121
- @param [String] name
122
- @return [Object]
123
-
124
- @method set_option(name, value)
125
- See +:h nvim_win_set_option()+
126
- @param [String] name
127
- @param [Object] value
128
- @return [void]
129
-
130
139
  @method get_position
131
140
  See +:h nvim_win_get_position()+
132
141
  @return [Array<Integer>]
@@ -143,20 +152,25 @@ module Neovim
143
152
  See +:h nvim_win_is_valid()+
144
153
  @return [Boolean]
145
154
 
146
- @method set_config(config)
147
- See +:h nvim_win_set_config()+
148
- @param [Hash] config
155
+ @method hide
156
+ See +:h nvim_win_hide()+
149
157
  @return [void]
150
158
 
151
- @method get_config
152
- See +:h nvim_win_get_config()+
153
- @return [Hash]
154
-
155
159
  @method close(force)
156
160
  See +:h nvim_win_close()+
157
161
  @param [Boolean] force
158
162
  @return [void]
159
163
 
164
+ @method call(fun)
165
+ See +:h nvim_win_call()+
166
+ @param [LuaRef] fun
167
+ @return [Object]
168
+
169
+ @method set_hl_ns(ns_id)
170
+ See +:h nvim_win_set_hl_ns()+
171
+ @param [Integer] ns_id
172
+ @return [void]
173
+
160
174
  =end
161
175
  end
162
176
  end
data/lib/neovim.rb CHANGED
@@ -10,11 +10,10 @@ require "neovim/version"
10
10
  # running +nvim+ instance programmatically or define a remote plugin to be
11
11
  # autoloaded by +nvim+.
12
12
  #
13
- # You can connect to a running +nvim+ instance by setting or inspecting the
14
- # +NVIM_LISTEN_ADDRESS+ environment variable and connecting via the appropriate
15
- # +attach_+ method. This is currently supported for both UNIX domain sockets
16
- # and TCP. You can also spawn and connect to an +nvim+ subprocess via
17
- # +Neovim.attach_child(argv)+.
13
+ # You can connect to a running +nvim+ process using the appropriate +attach_+
14
+ # method. This is currently supported for both UNIX domain sockets and TCP. You
15
+ # can also spawn and connect to an +nvim+ subprocess using
16
+ # +Neovim.attach_child+.
18
17
  #
19
18
  # You can define a remote plugin using the +Neovim.plugin+ DSL, which allows
20
19
  # you to register commands, functions, and autocmds. Plugins are autoloaded by
data/neovim.gemspec CHANGED
@@ -22,11 +22,10 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency "msgpack", "~> 1.1"
23
23
  spec.add_dependency "multi_json", "~> 1.0"
24
24
 
25
- spec.add_development_dependency "bundler", "~> 2.0"
26
- spec.add_development_dependency "pry"
25
+ spec.add_development_dependency "bundler"
26
+ spec.add_development_dependency "pry", "~> 0.14"
27
27
  spec.add_development_dependency "pry-byebug"
28
28
  spec.add_development_dependency "rake"
29
- spec.add_development_dependency "rspec", "~> 3.0"
30
- spec.add_development_dependency "rubocop", "0.56.0"
31
- spec.add_development_dependency "vim-flavor", "2.2.2"
29
+ spec.add_development_dependency "rspec"
30
+ spec.add_development_dependency "vim-flavor"
32
31
  end
@@ -2,32 +2,19 @@
2
2
 
3
3
  set -eu
4
4
 
5
- : ${RUNNER_OS:?} ${BUILD:?}
6
-
7
- case "$BUILD" in
8
- latest)
9
- URL_PART="latest/download"
10
- ;;
11
- nightly)
12
- URL_PART="download/nightly"
13
- ;;
14
- *)
15
- echo "BUILD must be 'latest' or 'nightly'." >&2
16
- exit 1
17
- ;;
18
- esac
5
+ : ${RUNNER_OS:?}
19
6
 
20
7
  case "$(echo "$RUNNER_OS" | tr "[:upper:]" "[:lower:]")" in
21
8
  macos)
22
9
  wget -nv -P /tmp \
23
- "https://github.com/neovim/neovim/releases/$URL_PART/nvim-macos.tar.gz"
10
+ "https://github.com/neovim/neovim/releases/download/stable/nvim-macos.tar.gz"
24
11
  tar -C /tmp -xzf /tmp/nvim-macos.tar.gz
25
- mv /tmp/nvim-osx64 ./_nvim
12
+ mv /tmp/nvim-macos ./_nvim
26
13
  ;;
27
14
  linux)
28
15
  mkdir -p _nvim/bin
29
16
  wget -nv -O _nvim/bin/nvim \
30
- "https://github.com/neovim/neovim/releases/$URL_PART/nvim.appimage"
17
+ "https://github.com/neovim/neovim/releases/download/stable/nvim.appimage"
31
18
  ;;
32
19
  *)
33
20
  echo "Unrecognized \$RUNNER_OS" >&2
@@ -8,7 +8,7 @@ ENV.delete("VIMRUNTIME")
8
8
  root = File.expand_path("..", __dir__)
9
9
  acceptance_root = File.join(root, "spec/acceptance")
10
10
  themis_rtp = File.join(acceptance_root, "runtime")
11
- themis_home = File.join(themis_rtp, "flavors/thinca_vim-themis")
11
+ themis_home = File.join(themis_rtp, "pack/flavors/start/thinca_vim-themis")
12
12
  manifest = File.join(themis_rtp, "rplugin_manifest.vim")
13
13
  vimrc = File.join(themis_rtp, "init.vim")
14
14
  nvim = ENV.fetch("NVIM_EXECUTABLE", "nvim")
@@ -77,8 +77,8 @@ function! s:suite.supports_register() abort
77
77
  endfunction
78
78
 
79
79
  function! s:suite.supports_completion() abort
80
- RPluginCommandCompletion
81
- call s:expect(g:rplugin_command_completion).to_equal("buffer")
80
+ RPluginCommandCompletion foo
81
+ call s:expect(g:rplugin_command_completion).to_equal(["buffer", "foo"])
82
82
  endfunction
83
83
 
84
84
  function! s:suite.supports_eval() abort
@@ -43,10 +43,10 @@ Neovim.plugin do |plug|
43
43
  nvim.set_var("rplugin_command_register", reg)
44
44
  end
45
45
 
46
- plug.command(:RPluginCommandCompletion, complete: "buffer", sync: true) do |nvim|
46
+ plug.command(:RPluginCommandCompletion, complete: "buffer", nargs: 1, sync: true) do |nvim, arg|
47
47
  attrs = nvim.command_output("silent command RPluginCommandCompletion")
48
48
  compl = attrs.split($/).last.split[2]
49
- nvim.set_var("rplugin_command_completion", compl)
49
+ nvim.set_var("rplugin_command_completion", [compl, arg])
50
50
  end
51
51
 
52
52
  plug.command(:RPluginCommandEval, eval: "g:to_eval", sync: true) do |nvim, to_eval|
data/spec/helper.rb CHANGED
@@ -54,9 +54,13 @@ RSpec.configure do |config|
54
54
  config.before(:example, :nvim_version) do |spec|
55
55
  comparator = spec.metadata.fetch(:nvim_version)
56
56
  requirement = Gem::Requirement.create(comparator)
57
- nvim_version = Gem::Version.new(Support.nvim_version)
58
57
 
59
- if !requirement.satisfied_by?(nvim_version)
58
+ nvim_version = Support
59
+ .nvim_version
60
+ .split("+")
61
+ .first
62
+
63
+ if !requirement.satisfied_by?(Gem::Version.new(nvim_version))
60
64
  skip "Skipping on nvim #{nvim_version} (requires #{comparator})"
61
65
  end
62
66
  end