neovim 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.gitmodules +1 -1
- data/.rspec +1 -0
- data/.travis.yml +1 -1
- data/CHANGELOG.md +8 -0
- data/README.md +5 -3
- data/Rakefile +14 -8
- data/lib/neovim/buffer.rb +86 -114
- data/lib/neovim/client.rb +105 -103
- data/lib/neovim/current.rb +8 -18
- data/lib/neovim/executable.rb +2 -2
- data/lib/neovim/line_range.rb +48 -59
- data/lib/neovim/plugin/dsl.rb +11 -3
- data/lib/neovim/remote_object.rb +3 -13
- data/lib/neovim/ruby_provider.rb +3 -3
- data/lib/neovim/ruby_provider/buffer_ext.rb +3 -3
- data/lib/neovim/ruby_provider/vim.rb +2 -2
- data/lib/neovim/ruby_provider/window_ext.rb +3 -3
- data/lib/neovim/session.rb +4 -4
- data/lib/neovim/session/api.rb +50 -22
- data/lib/neovim/tabpage.rb +29 -19
- data/lib/neovim/version.rb +1 -1
- data/lib/neovim/window.rb +60 -40
- data/script/dump_api +1 -1
- data/script/generate_docs +35 -22
- data/spec/helper.rb +3 -1
- data/spec/integration/rplugin_autocmd_spec.vim +18 -0
- data/spec/integration/rplugin_command_spec.vim +97 -0
- data/spec/integration/rplugin_function_spec.vim +26 -0
- data/spec/integration/ruby_buffer_spec.rb +151 -0
- data/spec/{acceptance → integration}/ruby_spec.vim +2 -22
- data/spec/integration/ruby_vim_spec.rb +27 -0
- data/spec/integration/ruby_window_spec.rb +56 -0
- data/spec/{acceptance → integration}/rubydo_spec.vim +27 -18
- data/spec/{acceptance → integration}/rubyfile/call_foo.rb +0 -0
- data/spec/{acceptance → integration}/rubyfile/curbuf_ivar_get.rb +0 -0
- data/spec/{acceptance → integration}/rubyfile/curbuf_ivar_set.rb +0 -0
- data/spec/{acceptance → integration}/rubyfile/define_foo.rb +0 -0
- data/spec/{acceptance → integration}/rubyfile/raise_standard_error.rb +0 -0
- data/spec/{acceptance → integration}/rubyfile/raise_syntax_error.rb +0 -0
- data/spec/{acceptance → integration}/rubyfile/set_pwd_after.rb +0 -0
- data/spec/{acceptance → integration}/rubyfile/set_pwd_before.rb +0 -0
- data/spec/{acceptance → integration}/rubyfile_spec.vim +12 -30
- data/spec/integration/runtime/init.vim +9 -0
- data/spec/integration/runtime/rplugin/ruby/autocmds.rb +9 -0
- data/spec/integration/runtime/rplugin/ruby/commands.rb +59 -0
- data/spec/integration/runtime/rplugin/ruby/functions.rb +17 -0
- data/spec/integration_spec.rb +119 -0
- data/spec/neovim/buffer_spec.rb +0 -167
- data/spec/neovim/client_spec.rb +1 -44
- data/spec/neovim/current_spec.rb +0 -8
- data/spec/neovim/line_range_spec.rb +92 -97
- data/spec/neovim/plugin_spec.rb +14 -2
- data/spec/neovim/remote_object_spec.rb +4 -4
- data/spec/neovim/ruby_provider/buffer_ext_spec.rb +3 -3
- data/spec/neovim/ruby_provider/window_ext_spec.rb +1 -1
- data/spec/neovim/session/api_spec.rb +40 -35
- data/spec/neovim/session/event_loop_spec.rb +1 -1
- data/spec/neovim/session_spec.rb +15 -15
- metadata +49 -41
- data/script/acceptance_tests +0 -46
- data/spec/acceptance/rplugin_spec.vim +0 -19
- data/spec/acceptance/rubyfile/curbuf.rb +0 -1
- data/spec/acceptance/rubyfile/curwin.rb +0 -1
- data/spec/acceptance/rubyfile/vim_constants.rb +0 -2
- data/spec/acceptance/runtime/init.vim +0 -1
- data/spec/acceptance/runtime/rplugin/ruby/plugin.rb +0 -13
- data/spec/documentation_spec.rb +0 -24
- data/spec/neovim/window_spec.rb +0 -91
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '056393636b2bb2d1a11454e495378d30b5b886de'
|
4
|
+
data.tar.gz: 32202a000db324574ec4b55bdff4ddb0eb1bc4ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7379f601e28d71f02f89c8687a38a9516e75def94af5a7c867c764f0538a6b4131adcbe503a80e90e48804e8802e0677f013337d597aaff25c87df2eb7fd7a0
|
7
|
+
data.tar.gz: a245f880c4c873421f2d41839ff0ea63e923dd25120bb112838881cd33b9bf4ba649dcc96206a836a83c821acd14d56a6125b8d752bdede2f9986a390e40906c
|
data/.gitignore
CHANGED
data/.gitmodules
CHANGED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--exclude-pattern 'spec/integration/**/*'
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# 0.5.0
|
2
|
+
- Breaking API changes:
|
3
|
+
- Update generated methods to map to `nvim_` RPC functions, rather than the
|
4
|
+
deprecated `vim_` ones
|
5
|
+
- Remove `Current#range` API, simplifying `LineRange` interface
|
6
|
+
- Regenerate docs to reflect nvim 0.2.0
|
7
|
+
- Fix support for `:bang` and `:register` plugin DSL options
|
8
|
+
|
1
9
|
# 0.4.0
|
2
10
|
- Add `Neovim.executable` for accessing `nvim` info
|
3
11
|
- Fix bug where `$curwin` and `$curbuf` got out of sync after `Vim.command`
|
data/README.md
CHANGED
@@ -44,10 +44,10 @@ Refer to the [`Neovim` docs](http://www.rubydoc.info/github/alexgenco/neovim-rub
|
|
44
44
|
|
45
45
|
### Plugins
|
46
46
|
|
47
|
-
|
47
|
+
Plugins are Ruby files loaded from the `$VIMRUNTIME/rplugin/ruby/` directory. Here's an example plugin:
|
48
48
|
|
49
49
|
```ruby
|
50
|
-
#
|
50
|
+
# ~/.config/nvim/rplugin/ruby/example_plugin.rb
|
51
51
|
|
52
52
|
Neovim.plugin do |plug|
|
53
53
|
# Define a command called "SetLine" which sets the contents of the current
|
@@ -70,7 +70,9 @@ Neovim.plugin do |plug|
|
|
70
70
|
end
|
71
71
|
```
|
72
72
|
|
73
|
-
|
73
|
+
When you add or update a plugin, you will need to call `:UpdateRemotePlugins` to update the remote plugin manifest. See `:help remote-plugin-manifest` for more information.
|
74
|
+
|
75
|
+
Refer to the [`Neovim::Plugin::DSL` docs](http://www.rubydoc.info/github/alexgenco/neovim-ruby/master/Neovim/Plugin/DSL) for a more complete overview of the `Neovim.plugin` DSL.
|
74
76
|
|
75
77
|
### Legacy Plugin Support
|
76
78
|
|
data/Rakefile
CHANGED
@@ -11,16 +11,22 @@ task :api do
|
|
11
11
|
sh File.expand_path("../script/dump_api", __FILE__)
|
12
12
|
end
|
13
13
|
|
14
|
+
desc "Initialize and update git submodules"
|
15
|
+
task :submodules do
|
16
|
+
sh "git submodule update --init"
|
17
|
+
end
|
18
|
+
|
14
19
|
namespace :spec do
|
15
|
-
desc "Run functional
|
16
|
-
RSpec::Core::RakeTask.new(:functional)
|
20
|
+
desc "Run functional specs"
|
21
|
+
RSpec::Core::RakeTask.new(:functional) do |t|
|
22
|
+
t.exclude_pattern = "spec/integration_spec.rb,spec/integration/**/*"
|
23
|
+
end
|
17
24
|
|
18
|
-
desc "Run
|
19
|
-
|
20
|
-
|
21
|
-
sh File.expand_path("../script/acceptance_tests", __FILE__)
|
25
|
+
desc "Run integration specs"
|
26
|
+
RSpec::Core::RakeTask.new(:integration => :submodules) do |t|
|
27
|
+
t.pattern = "spec/integration_spec.rb"
|
22
28
|
end
|
23
29
|
end
|
24
30
|
|
25
|
-
|
26
|
-
task :default =>
|
31
|
+
RSpec::Core::RakeTask.new(:spec => :submodules)
|
32
|
+
task :default => :spec
|
data/lib/neovim/buffer.rb
CHANGED
@@ -4,14 +4,13 @@ require "neovim/line_range"
|
|
4
4
|
module Neovim
|
5
5
|
# Class representing an +nvim+ buffer.
|
6
6
|
#
|
7
|
-
# The methods documented here were generated using NVIM v0.
|
7
|
+
# The methods documented here were generated using NVIM v0.2.0
|
8
8
|
class Buffer < RemoteObject
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
@lines ||= LineRange.new(self, 0, -1)
|
9
|
+
attr_reader :lines
|
10
|
+
|
11
|
+
def initialize(*args)
|
12
|
+
super
|
13
|
+
@lines = LineRange.new(self)
|
15
14
|
end
|
16
15
|
|
17
16
|
# Replace all the lines of the buffer.
|
@@ -19,25 +18,7 @@ module Neovim
|
|
19
18
|
# @param strs [Array<String>] The replacement lines
|
20
19
|
# @return [Array<String>]
|
21
20
|
def lines=(strs)
|
22
|
-
lines[0..-1] = strs
|
23
|
-
end
|
24
|
-
|
25
|
-
# A +LineRange+ object representing the buffer's selection range.
|
26
|
-
#
|
27
|
-
# @return [LineRange]
|
28
|
-
# @see LineRange
|
29
|
-
def range
|
30
|
-
@range ||= LineRange.new(self, 0, -1)
|
31
|
-
end
|
32
|
-
|
33
|
-
# Set the buffer's current selection range.
|
34
|
-
#
|
35
|
-
# @param _range [Range] The replacement range
|
36
|
-
# @return [LineRange]
|
37
|
-
# @see LineRange
|
38
|
-
def range=(_range)
|
39
|
-
_end = _range.exclude_end? ? _range.end - 1 : _range.end
|
40
|
-
@range = LineRange.new(self, _range.begin, _end)
|
21
|
+
@lines[0..-1] = strs
|
41
22
|
end
|
42
23
|
|
43
24
|
# Get the buffer name.
|
@@ -73,7 +54,8 @@ module Neovim
|
|
73
54
|
# @param index [Integer]
|
74
55
|
# @return [String]
|
75
56
|
def [](index)
|
76
|
-
|
57
|
+
check_index(index)
|
58
|
+
@lines[index-1]
|
77
59
|
end
|
78
60
|
|
79
61
|
# Set the given line (1-indexed).
|
@@ -82,7 +64,8 @@ module Neovim
|
|
82
64
|
# @param str [String]
|
83
65
|
# @return [String]
|
84
66
|
def []=(index, str)
|
85
|
-
|
67
|
+
check_index(index)
|
68
|
+
@lines[index-1] = str
|
86
69
|
end
|
87
70
|
|
88
71
|
# Delete the given line (1-indexed).
|
@@ -90,7 +73,9 @@ module Neovim
|
|
90
73
|
# @param index [Integer]
|
91
74
|
# @return [void]
|
92
75
|
def delete(index)
|
93
|
-
|
76
|
+
check_index(index)
|
77
|
+
@lines.delete(index-1)
|
78
|
+
nil
|
94
79
|
end
|
95
80
|
|
96
81
|
# Append a line after the given line (1-indexed).
|
@@ -102,15 +87,12 @@ module Neovim
|
|
102
87
|
# @param str [String]
|
103
88
|
# @return [String]
|
104
89
|
def append(index, str)
|
105
|
-
|
90
|
+
check_index(index)
|
91
|
+
window = @session.request(:nvim_get_current_win)
|
106
92
|
cursor = window.cursor
|
107
93
|
|
108
|
-
|
109
|
-
|
110
|
-
else
|
111
|
-
set_lines(index, index, true, [str])
|
112
|
-
window.set_cursor(cursor)
|
113
|
-
end
|
94
|
+
set_lines(index, index, true, [str])
|
95
|
+
window.set_cursor(cursor)
|
114
96
|
str
|
115
97
|
end
|
116
98
|
|
@@ -119,7 +101,7 @@ module Neovim
|
|
119
101
|
# @return [String, nil]
|
120
102
|
def line
|
121
103
|
if active?
|
122
|
-
@session.request(:
|
104
|
+
@session.request(:nvim_get_current_line)
|
123
105
|
end
|
124
106
|
end
|
125
107
|
|
@@ -129,7 +111,7 @@ module Neovim
|
|
129
111
|
# @return [String, nil]
|
130
112
|
def line=(str)
|
131
113
|
if active?
|
132
|
-
@session.request(:
|
114
|
+
@session.request(:nvim_set_current_line, str)
|
133
115
|
end
|
134
116
|
end
|
135
117
|
|
@@ -138,8 +120,7 @@ module Neovim
|
|
138
120
|
# @return [Integer, nil]
|
139
121
|
def line_number
|
140
122
|
if active?
|
141
|
-
|
142
|
-
@session.request(:window_get_cursor, window)[0]
|
123
|
+
@session.request(:nvim_get_current_win).get_cursor[0]
|
143
124
|
end
|
144
125
|
end
|
145
126
|
|
@@ -147,120 +128,110 @@ module Neovim
|
|
147
128
|
#
|
148
129
|
# @return [Boolean]
|
149
130
|
def active?
|
150
|
-
@session.request(:
|
131
|
+
@session.request(:nvim_get_current_buf) == self
|
151
132
|
end
|
152
133
|
|
153
|
-
|
154
|
-
=begin
|
155
|
-
@method get_line(index)
|
156
|
-
Send the +buffer_get_line+ RPC to +nvim+
|
157
|
-
@param [Integer] index
|
158
|
-
@return [String]
|
134
|
+
private
|
159
135
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
136
|
+
def check_index(index)
|
137
|
+
if index < 0
|
138
|
+
raise ArgumentError, "Index out of bounds"
|
139
|
+
end
|
140
|
+
end
|
165
141
|
|
166
|
-
|
167
|
-
Send the +buffer_del_line+ RPC to +nvim+
|
168
|
-
@param [Integer] index
|
169
|
-
@return [void]
|
142
|
+
public
|
170
143
|
|
171
|
-
|
172
|
-
|
144
|
+
# The following methods are dynamically generated.
|
145
|
+
=begin
|
146
|
+
@method line_count(buffer)
|
147
|
+
See +:h nvim_buf_line_count()+
|
148
|
+
@param [Buffer] buffer
|
149
|
+
@return [Integer]
|
150
|
+
|
151
|
+
@method get_lines(buffer, start, end, strict_indexing)
|
152
|
+
See +:h nvim_buf_get_lines()+
|
153
|
+
@param [Buffer] buffer
|
173
154
|
@param [Integer] start
|
174
155
|
@param [Integer] end
|
175
|
-
@param [Boolean]
|
176
|
-
@param [Boolean] include_end
|
156
|
+
@param [Boolean] strict_indexing
|
177
157
|
@return [Array<String>]
|
178
158
|
|
179
|
-
@method
|
180
|
-
|
159
|
+
@method set_lines(buffer, start, end, strict_indexing, replacement)
|
160
|
+
See +:h nvim_buf_set_lines()+
|
161
|
+
@param [Buffer] buffer
|
181
162
|
@param [Integer] start
|
182
163
|
@param [Integer] end
|
183
|
-
@param [Boolean]
|
184
|
-
@param [Boolean] include_end
|
164
|
+
@param [Boolean] strict_indexing
|
185
165
|
@param [Array<String>] replacement
|
186
166
|
@return [void]
|
187
167
|
|
188
|
-
@method
|
189
|
-
|
168
|
+
@method get_var(buffer, name)
|
169
|
+
See +:h nvim_buf_get_var()+
|
170
|
+
@param [Buffer] buffer
|
190
171
|
@param [String] name
|
191
|
-
@param [Object] value
|
192
172
|
@return [Object]
|
193
173
|
|
194
|
-
@method
|
195
|
-
|
196
|
-
@param [
|
197
|
-
@return [Object]
|
198
|
-
|
199
|
-
@method insert(lnum, lines)
|
200
|
-
Send the +buffer_insert+ RPC to +nvim+
|
201
|
-
@param [Integer] lnum
|
202
|
-
@param [Array<String>] lines
|
203
|
-
@return [void]
|
204
|
-
|
205
|
-
@method line_count
|
206
|
-
Send the +buffer_line_count+ RPC to +nvim+
|
174
|
+
@method get_changedtick(buffer)
|
175
|
+
See +:h nvim_buf_get_changedtick()+
|
176
|
+
@param [Buffer] buffer
|
207
177
|
@return [Integer]
|
208
178
|
|
209
|
-
@method
|
210
|
-
|
211
|
-
@param [
|
212
|
-
@param [
|
213
|
-
@param [
|
214
|
-
@return [Array<String>]
|
215
|
-
|
216
|
-
@method set_lines(start, end, strict_indexing, replacement)
|
217
|
-
Send the +buffer_set_lines+ RPC to +nvim+
|
218
|
-
@param [Integer] start
|
219
|
-
@param [Integer] end
|
220
|
-
@param [Boolean] strict_indexing
|
221
|
-
@param [Array<String>] replacement
|
179
|
+
@method set_var(buffer, name, value)
|
180
|
+
See +:h nvim_buf_set_var()+
|
181
|
+
@param [Buffer] buffer
|
182
|
+
@param [String] name
|
183
|
+
@param [Object] value
|
222
184
|
@return [void]
|
223
185
|
|
224
|
-
@method
|
225
|
-
|
186
|
+
@method del_var(buffer, name)
|
187
|
+
See +:h nvim_buf_del_var()+
|
188
|
+
@param [Buffer] buffer
|
226
189
|
@param [String] name
|
227
|
-
@return [
|
190
|
+
@return [void]
|
228
191
|
|
229
|
-
@method get_option(name)
|
230
|
-
|
192
|
+
@method get_option(buffer, name)
|
193
|
+
See +:h nvim_buf_get_option()+
|
194
|
+
@param [Buffer] buffer
|
231
195
|
@param [String] name
|
232
196
|
@return [Object]
|
233
197
|
|
234
|
-
@method set_option(name, value)
|
235
|
-
|
198
|
+
@method set_option(buffer, name, value)
|
199
|
+
See +:h nvim_buf_set_option()+
|
200
|
+
@param [Buffer] buffer
|
236
201
|
@param [String] name
|
237
202
|
@param [Object] value
|
238
203
|
@return [void]
|
239
204
|
|
240
|
-
@method get_number
|
241
|
-
|
205
|
+
@method get_number(buffer)
|
206
|
+
See +:h nvim_buf_get_number()+
|
207
|
+
@param [Buffer] buffer
|
242
208
|
@return [Integer]
|
243
209
|
|
244
|
-
@method get_name
|
245
|
-
|
210
|
+
@method get_name(buffer)
|
211
|
+
See +:h nvim_buf_get_name()+
|
212
|
+
@param [Buffer] buffer
|
246
213
|
@return [String]
|
247
214
|
|
248
|
-
@method set_name(name)
|
249
|
-
|
215
|
+
@method set_name(buffer, name)
|
216
|
+
See +:h nvim_buf_set_name()+
|
217
|
+
@param [Buffer] buffer
|
250
218
|
@param [String] name
|
251
219
|
@return [void]
|
252
220
|
|
253
|
-
@method is_valid
|
254
|
-
|
221
|
+
@method is_valid(buffer)
|
222
|
+
See +:h nvim_buf_is_valid()+
|
223
|
+
@param [Buffer] buffer
|
255
224
|
@return [Boolean]
|
256
225
|
|
257
|
-
@method get_mark(name)
|
258
|
-
|
226
|
+
@method get_mark(buffer, name)
|
227
|
+
See +:h nvim_buf_get_mark()+
|
228
|
+
@param [Buffer] buffer
|
259
229
|
@param [String] name
|
260
230
|
@return [Array<Integer>]
|
261
231
|
|
262
|
-
@method add_highlight(src_id, hl_group, line, col_start, col_end)
|
263
|
-
|
232
|
+
@method add_highlight(buffer, src_id, hl_group, line, col_start, col_end)
|
233
|
+
See +:h nvim_buf_add_highlight()+
|
234
|
+
@param [Buffer] buffer
|
264
235
|
@param [Integer] src_id
|
265
236
|
@param [String] hl_group
|
266
237
|
@param [Integer] line
|
@@ -268,8 +239,9 @@ module Neovim
|
|
268
239
|
@param [Integer] col_end
|
269
240
|
@return [Integer]
|
270
241
|
|
271
|
-
@method clear_highlight(src_id, line_start, line_end)
|
272
|
-
|
242
|
+
@method clear_highlight(buffer, src_id, line_start, line_end)
|
243
|
+
See +:h nvim_buf_clear_highlight()+
|
244
|
+
@param [Buffer] buffer
|
273
245
|
@param [Integer] src_id
|
274
246
|
@param [Integer] line_start
|
275
247
|
@param [Integer] line_end
|
data/lib/neovim/client.rb
CHANGED
@@ -2,11 +2,11 @@ require "neovim/current"
|
|
2
2
|
|
3
3
|
module Neovim
|
4
4
|
# Client to a running +nvim+ instance. The interface is generated at
|
5
|
-
# runtime via the +
|
5
|
+
# runtime via the +nvim_get_api_info+ RPC call. Some methods return
|
6
6
|
# +RemoteObject+ subclasses (i.e. +Buffer+, +Window+, or +Tabpage+),
|
7
7
|
# which similarly have dynamically generated interfaces.
|
8
8
|
#
|
9
|
-
# The methods documented here were generated using NVIM v0.
|
9
|
+
# The methods documented here were generated using NVIM v0.2.0
|
10
10
|
#
|
11
11
|
# @see Buffer
|
12
12
|
# @see Window
|
@@ -24,7 +24,7 @@ module Neovim
|
|
24
24
|
|
25
25
|
# Intercept method calls and delegate to appropriate RPC methods.
|
26
26
|
def method_missing(method_name, *args)
|
27
|
-
if func = @api.
|
27
|
+
if func = @api.function_for_object_method(self, method_name)
|
28
28
|
func.call(@session, *args)
|
29
29
|
else
|
30
30
|
super
|
@@ -37,7 +37,7 @@ module Neovim
|
|
37
37
|
end
|
38
38
|
|
39
39
|
# Extend +methods+ to include RPC methods.
|
40
|
-
def methods
|
40
|
+
def methods(*args)
|
41
41
|
super | rpc_methods
|
42
42
|
end
|
43
43
|
|
@@ -53,14 +53,14 @@ module Neovim
|
|
53
53
|
@current ||= Current.new(@session)
|
54
54
|
end
|
55
55
|
|
56
|
-
# Evaluate the VimL expression (alias for +
|
56
|
+
# Evaluate the VimL expression (alias for +nvim_eval+).
|
57
57
|
#
|
58
58
|
# @param expr [String] A VimL expression.
|
59
59
|
# @return [Object]
|
60
60
|
# @example Return a list from VimL
|
61
61
|
# client.evaluate('[1, 2]') # => [1, 2]
|
62
62
|
def evaluate(expr)
|
63
|
-
@api.
|
63
|
+
@api.function_for_object_method(self, :eval).call(@session, expr)
|
64
64
|
end
|
65
65
|
|
66
66
|
# Display a message.
|
@@ -85,9 +85,9 @@ module Neovim
|
|
85
85
|
# client.set_option("timeoutlen=0")
|
86
86
|
def set_option(*args)
|
87
87
|
if args.size > 1
|
88
|
-
@api.
|
88
|
+
@api.function_for_object_method(self, :set_option).call(@session, *args)
|
89
89
|
else
|
90
|
-
@api.
|
90
|
+
@api.function_for_object_method(self, :command).call(@session, "set #{args.first}")
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
@@ -98,184 +98,186 @@ module Neovim
|
|
98
98
|
private
|
99
99
|
|
100
100
|
def rpc_methods
|
101
|
-
@api.
|
102
|
-
func.name.sub(/\Avim_/, "").to_sym
|
103
|
-
end
|
101
|
+
@api.functions_for_object(self).map(&:method_name)
|
104
102
|
end
|
105
103
|
|
106
104
|
public
|
107
105
|
|
108
106
|
# The following methods are dynamically generated.
|
109
107
|
=begin
|
110
|
-
@method
|
111
|
-
|
112
|
-
@param [
|
113
|
-
@param [
|
114
|
-
@return [
|
108
|
+
@method ui_attach(height, options)
|
109
|
+
See +:h nvim_ui_attach()+
|
110
|
+
@param [Integer] height
|
111
|
+
@param [Hash] options
|
112
|
+
@return [void]
|
115
113
|
|
116
|
-
@method
|
117
|
-
|
118
|
-
@
|
119
|
-
@return [Object]
|
114
|
+
@method ui_detach
|
115
|
+
See +:h nvim_ui_detach()+
|
116
|
+
@return [void]
|
120
117
|
|
121
|
-
@method
|
122
|
-
|
123
|
-
@param [
|
118
|
+
@method ui_try_resize(height)
|
119
|
+
See +:h nvim_ui_try_resize()+
|
120
|
+
@param [Integer] height
|
124
121
|
@return [void]
|
125
122
|
|
126
|
-
@method
|
127
|
-
|
128
|
-
@param [
|
123
|
+
@method ui_set_option(value)
|
124
|
+
See +:h nvim_ui_set_option()+
|
125
|
+
@param [Object] value
|
126
|
+
@return [void]
|
127
|
+
|
128
|
+
@method command
|
129
|
+
See +:h nvim_command()+
|
130
|
+
@return [void]
|
131
|
+
|
132
|
+
@method feedkeys(mode, escape_csi)
|
133
|
+
See +:h nvim_feedkeys()+
|
129
134
|
@param [String] mode
|
130
135
|
@param [Boolean] escape_csi
|
131
136
|
@return [void]
|
132
137
|
|
133
|
-
@method input
|
134
|
-
|
135
|
-
@param [String] keys
|
138
|
+
@method input
|
139
|
+
See +:h nvim_input()+
|
136
140
|
@return [Integer]
|
137
141
|
|
138
|
-
@method replace_termcodes(
|
139
|
-
|
140
|
-
@param [String] str
|
142
|
+
@method replace_termcodes(from_part, do_lt, special)
|
143
|
+
See +:h nvim_replace_termcodes()+
|
141
144
|
@param [Boolean] from_part
|
142
145
|
@param [Boolean] do_lt
|
143
146
|
@param [Boolean] special
|
144
147
|
@return [String]
|
145
148
|
|
146
|
-
@method command_output
|
147
|
-
|
148
|
-
@param [String] str
|
149
|
+
@method command_output
|
150
|
+
See +:h nvim_command_output()+
|
149
151
|
@return [String]
|
150
152
|
|
151
|
-
@method eval
|
152
|
-
|
153
|
-
@param [String] expr
|
153
|
+
@method eval
|
154
|
+
See +:h nvim_eval()+
|
154
155
|
@return [Object]
|
155
156
|
|
156
|
-
@method call_function(
|
157
|
-
|
158
|
-
@param [String] fname
|
157
|
+
@method call_function(args)
|
158
|
+
See +:h nvim_call_function()+
|
159
159
|
@param [Array] args
|
160
160
|
@return [Object]
|
161
161
|
|
162
|
-
@method strwidth
|
163
|
-
|
164
|
-
@param [String] str
|
162
|
+
@method strwidth
|
163
|
+
See +:h nvim_strwidth()+
|
165
164
|
@return [Integer]
|
166
165
|
|
167
166
|
@method list_runtime_paths
|
168
|
-
|
167
|
+
See +:h nvim_list_runtime_paths()+
|
169
168
|
@return [Array<String>]
|
170
169
|
|
171
|
-
@method
|
172
|
-
|
173
|
-
@param [String] dir
|
170
|
+
@method set_current_dir
|
171
|
+
See +:h nvim_set_current_dir()+
|
174
172
|
@return [void]
|
175
173
|
|
176
174
|
@method get_current_line
|
177
|
-
|
175
|
+
See +:h nvim_get_current_line()+
|
178
176
|
@return [String]
|
179
177
|
|
180
|
-
@method set_current_line
|
181
|
-
|
182
|
-
@param [String] line
|
178
|
+
@method set_current_line
|
179
|
+
See +:h nvim_set_current_line()+
|
183
180
|
@return [void]
|
184
181
|
|
185
182
|
@method del_current_line
|
186
|
-
|
183
|
+
See +:h nvim_del_current_line()+
|
187
184
|
@return [void]
|
188
185
|
|
189
|
-
@method get_var
|
190
|
-
|
191
|
-
@param [String] name
|
186
|
+
@method get_var
|
187
|
+
See +:h nvim_get_var()+
|
192
188
|
@return [Object]
|
193
189
|
|
194
|
-
@method
|
195
|
-
|
196
|
-
@param [
|
190
|
+
@method set_var(value)
|
191
|
+
See +:h nvim_set_var()+
|
192
|
+
@param [Object] value
|
193
|
+
@return [void]
|
194
|
+
|
195
|
+
@method del_var
|
196
|
+
See +:h nvim_del_var()+
|
197
|
+
@return [void]
|
198
|
+
|
199
|
+
@method get_vvar
|
200
|
+
See +:h nvim_get_vvar()+
|
197
201
|
@return [Object]
|
198
202
|
|
199
|
-
@method get_option
|
200
|
-
|
201
|
-
@param [String] name
|
203
|
+
@method get_option
|
204
|
+
See +:h nvim_get_option()+
|
202
205
|
@return [Object]
|
203
206
|
|
204
|
-
@method out_write
|
205
|
-
|
206
|
-
@param [String] str
|
207
|
+
@method out_write
|
208
|
+
See +:h nvim_out_write()+
|
207
209
|
@return [void]
|
208
210
|
|
209
|
-
@method err_write
|
210
|
-
|
211
|
-
@param [String] str
|
211
|
+
@method err_write
|
212
|
+
See +:h nvim_err_write()+
|
212
213
|
@return [void]
|
213
214
|
|
214
|
-
@method
|
215
|
-
|
216
|
-
@param [String] str
|
215
|
+
@method err_writeln
|
216
|
+
See +:h nvim_err_writeln()+
|
217
217
|
@return [void]
|
218
218
|
|
219
|
-
@method
|
220
|
-
|
219
|
+
@method list_bufs
|
220
|
+
See +:h nvim_list_bufs()+
|
221
221
|
@return [Array<Buffer>]
|
222
222
|
|
223
|
-
@method
|
224
|
-
|
223
|
+
@method get_current_buf
|
224
|
+
See +:h nvim_get_current_buf()+
|
225
225
|
@return [Buffer]
|
226
226
|
|
227
|
-
@method
|
228
|
-
|
229
|
-
@param [Buffer] buffer
|
227
|
+
@method set_current_buf
|
228
|
+
See +:h nvim_set_current_buf()+
|
230
229
|
@return [void]
|
231
230
|
|
232
|
-
@method
|
233
|
-
|
231
|
+
@method list_wins
|
232
|
+
See +:h nvim_list_wins()+
|
234
233
|
@return [Array<Window>]
|
235
234
|
|
236
|
-
@method
|
237
|
-
|
235
|
+
@method get_current_win
|
236
|
+
See +:h nvim_get_current_win()+
|
238
237
|
@return [Window]
|
239
238
|
|
240
|
-
@method
|
241
|
-
|
242
|
-
@param [Window] window
|
239
|
+
@method set_current_win
|
240
|
+
See +:h nvim_set_current_win()+
|
243
241
|
@return [void]
|
244
242
|
|
245
|
-
@method
|
246
|
-
|
243
|
+
@method list_tabpages
|
244
|
+
See +:h nvim_list_tabpages()+
|
247
245
|
@return [Array<Tabpage>]
|
248
246
|
|
249
247
|
@method get_current_tabpage
|
250
|
-
|
248
|
+
See +:h nvim_get_current_tabpage()+
|
251
249
|
@return [Tabpage]
|
252
250
|
|
253
|
-
@method set_current_tabpage
|
254
|
-
|
255
|
-
@param [Tabpage] tabpage
|
251
|
+
@method set_current_tabpage
|
252
|
+
See +:h nvim_set_current_tabpage()+
|
256
253
|
@return [void]
|
257
254
|
|
258
|
-
@method subscribe
|
259
|
-
|
260
|
-
@param [String] event
|
255
|
+
@method subscribe
|
256
|
+
See +:h nvim_subscribe()+
|
261
257
|
@return [void]
|
262
258
|
|
263
|
-
@method unsubscribe
|
264
|
-
|
265
|
-
@param [String] event
|
259
|
+
@method unsubscribe
|
260
|
+
See +:h nvim_unsubscribe()+
|
266
261
|
@return [void]
|
267
262
|
|
268
|
-
@method
|
269
|
-
|
270
|
-
@param [String] name
|
263
|
+
@method get_color_by_name
|
264
|
+
See +:h nvim_get_color_by_name()+
|
271
265
|
@return [Integer]
|
272
266
|
|
273
267
|
@method get_color_map
|
274
|
-
|
275
|
-
@return [
|
268
|
+
See +:h nvim_get_color_map()+
|
269
|
+
@return [Hash]
|
270
|
+
|
271
|
+
@method get_mode
|
272
|
+
See +:h nvim_get_mode()+
|
273
|
+
@return [Hash]
|
276
274
|
|
277
275
|
@method get_api_info
|
278
|
-
|
276
|
+
See +:h nvim_get_api_info()+
|
277
|
+
@return [Array]
|
278
|
+
|
279
|
+
@method call_atomic
|
280
|
+
See +:h nvim_call_atomic()+
|
279
281
|
@return [Array]
|
280
282
|
|
281
283
|
=end
|