neovim 0.9.0.pre.1 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b1d22feedf4011597b4ef37233dbc13f1f874fa7bb03986d21a4e1cbe0d3f21
4
- data.tar.gz: 63f008322d89124368e2d3c556dd14e8734874d9ffd7c96ef77556efeda69b5b
3
+ metadata.gz: d86525bb60d51c356a2c75f368d248991a207c7875348a88181a3f7156b6051a
4
+ data.tar.gz: cb88fe16e651b54a671ae95f1ea71b692fa5f9c9348f16ce0f38218c98b7b90a
5
5
  SHA512:
6
- metadata.gz: 556a087351aee954365afc96f6f57bc4f47bab4dd0333db4d8a55025c578068275b91186d6509a7b160faa20a8863be72aaa09866dcc604490a1aaf92e26c6c5
7
- data.tar.gz: 23dbec9563bae88cdd3ed4315c1f1ff36cfdc2446b438c162da1633cd0e5e40b1f0f1f92d8a2d457c80b8b9e73ef6ad84bcb9d18870aab91a73a2bf053743dfd
6
+ metadata.gz: f24def6fc7afdab94cb605e5f9fb721d3b621841ebda9016ba26ab4acabf10dba0ad3b79c278c009fdf153654181a1c18b69385445e19627b91494db048d546c
7
+ data.tar.gz: f64be9703c9c312fb5571108838b199f4d5349ced2dcac12a32936db8a9f847222643ee05cd37b67a7671c8e92124489703df54ff5ef134d8875e8f546f46b9c
@@ -1,13 +1,16 @@
1
1
  name: Docs
2
2
  on:
3
3
  push:
4
- branches: [master]
4
+ branches: [main]
5
5
  schedule:
6
6
  - cron: '0 0 * * 0'
7
7
  jobs:
8
8
  docs:
9
9
  runs-on: ubuntu-latest
10
10
  if: "!contains(github.event.head_commit.message, '[skip ci]')"
11
+ permissions:
12
+ contents: write
13
+ pull-requests: write
11
14
  steps:
12
15
  - uses: actions/checkout@v2
13
16
  with:
@@ -15,20 +18,20 @@ jobs:
15
18
  - uses: ruby/setup-ruby@v1
16
19
  with:
17
20
  ruby-version: head
21
+ - name: Install libfuse
22
+ run: sudo apt install libfuse2
18
23
  - name: Bundle install
19
24
  run: |
20
25
  bundle config set path vendor/bundle
21
26
  bundle install --jobs 3 --retry 3
22
27
  - name: Install Neovim
23
- env:
24
- BUILD: latest
25
28
  run: bundle exec rake ci:download_nvim
26
29
  - name: Generate docs
27
30
  env:
28
31
  NVIM_EXECUTABLE: "_nvim/bin/nvim"
29
32
  run: bundle exec rake docs:generate
30
33
  - name: Open pull request
31
- uses: peter-evans/create-pull-request@v2
34
+ uses: peter-evans/create-pull-request@v3
32
35
  with:
33
36
  token: ${{ secrets.GITHUB_TOKEN }}
34
37
  commit-message: "[skip ci] Update generated docs"
@@ -1,9 +1,9 @@
1
1
  name: Tests
2
2
  on:
3
3
  push:
4
- branches: [master]
4
+ branches: [main]
5
5
  pull_request:
6
- branches: [master]
6
+ branches: [main]
7
7
  schedule:
8
8
  - cron: '0 0 * * 0'
9
9
  jobs:
@@ -12,23 +12,23 @@ jobs:
12
12
  fail-fast: false
13
13
  matrix:
14
14
  os: [ubuntu-latest, macos-latest]
15
- ruby: [2.5, 2.6, 2.7, head]
15
+ ruby: [2.7, 3.0, 3.1, 3.2, head]
16
16
  runs-on: ${{ matrix.os }}
17
17
  if: "!contains(github.event.head_commit.message, '[skip ci]')"
18
18
  steps:
19
+ - name: Fix up git URLs
20
+ run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig
19
21
  - uses: actions/checkout@v2
20
22
  with:
21
23
  repository: neovim/neovim-ruby
22
24
  - uses: ruby/setup-ruby@v1
23
25
  with:
24
26
  ruby-version: ${{ matrix.ruby }}
25
- - name: Bundle install
26
- run: |
27
- bundle config set path vendor/bundle
28
- bundle install --jobs 3 --retry 3
27
+ bundler-cache: true
28
+ - name: Install libfuse
29
+ run: sudo apt install libfuse2
30
+ if: matrix.os == 'ubuntu-latest'
29
31
  - name: Install Neovim
30
- env:
31
- BUILD: nightly
32
32
  run: bundle exec rake ci:download_nvim
33
33
  - name: Run tests
34
34
  env:
@@ -38,25 +38,27 @@ jobs:
38
38
  strategy:
39
39
  fail-fast: false
40
40
  matrix:
41
- ruby: [2.5, 2.6, 2.7] # msgpack not supported on windows on 2.8 yet
41
+ ruby: [2.7, 3.0, 3.1, 3.2]
42
42
  runs-on: windows-latest
43
43
  if: "!contains(github.event.head_commit.message, '[skip ci]')"
44
44
  steps:
45
+ - name: Fix up git URLs
46
+ run: |
47
+ echo '[url "https://github.com/"]' >> ~/.gitconfig
48
+ echo ' insteadOf = "git://github.com/"' >> ~/.gitconfig
45
49
  - uses: actions/checkout@v2
46
50
  with:
47
51
  repository: neovim/neovim-ruby
48
52
  - uses: ruby/setup-ruby@v1
49
53
  with:
50
54
  ruby-version: ${{ matrix.ruby }}
51
- - name: Bundle install
52
- run: |
53
- bundle config set path vendor/bundle
54
- bundle install --jobs 3 --retry 3
55
+ bundler-cache: true
55
56
  - name: Install Neovim
56
57
  uses: crazy-max/ghaction-chocolatey@v1
57
58
  with:
58
- args: install neovim --pre -fy --ignore-dependencies --ignore-checksums
59
+ args: install neovim -fy --ignore-dependencies --ignore-checksums
59
60
  - name: Run tests
60
61
  env:
61
- NVIM_EXECUTABLE: 'C:\tools\neovim\Neovim\bin\nvim'
62
+ VIM_FLAVOR_HOME: 'D:\'
63
+ NVIM_EXECUTABLE: 'C:\tools\neovim\nvim-win64\bin\nvim'
62
64
  run: bundle exec rake spec
data/.gitignore CHANGED
@@ -18,7 +18,7 @@ test/tmp
18
18
  test/version_tmp
19
19
  tmp
20
20
  spec/workspace
21
- spec/acceptance/runtime/flavors
21
+ spec/acceptance/runtime/pack
22
22
  spec/acceptance/runtime/rplugin_manifest.vim
23
23
  vendor/bundle
24
24
  bin
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.9.1
2
+
3
+ - Fix bug where `Buffer#[]` with `0` returned the last line of the buffer
4
+ (https://github.com/neovim/neovim-ruby/issues/97)
5
+
1
6
  # 0.9.0
2
7
 
3
8
  - Add RPC support for `:rubyeval`.
data/Flavorfile.lock ADDED
@@ -0,0 +1 @@
1
+ thinca/vim-themis (737e5444713ba53a9dcfbe3b962239bd0bd9162e at master)
data/README.md CHANGED
@@ -27,10 +27,10 @@ gem install neovim
27
27
 
28
28
  ## Usage
29
29
 
30
- You can control a running `nvim` process by connecting to `$NVIM_LISTEN_ADDRESS`. For example, to connect to `nvim` over a UNIX domain socket, start it up like this:
30
+ Neovim supports the `--listen` option for specifying an address to serve its RPC API. To connect to Neovim over a Unix socket, start it up like this:
31
31
 
32
32
  ```shell
33
- $ NVIM_LISTEN_ADDRESS=/tmp/nvim.sock nvim
33
+ $ nvim --listen /tmp/nvim.sock
34
34
  ```
35
35
 
36
36
  You can then connect to that socket path to get a `Neovim::Client`:
@@ -40,7 +40,7 @@ require "neovim"
40
40
  client = Neovim.attach_unix("/tmp/nvim.sock")
41
41
  ```
42
42
 
43
- Refer to the [`Neovim` docs](https://www.rubydoc.info/github/neovim/neovim-ruby/master/Neovim) for other ways to connect to `nvim`, and the [`Neovim::Client` docs](https://www.rubydoc.info/github/neovim/neovim-ruby/master/Neovim/Client) for a summary of the client interface.
43
+ Refer to the [`Neovim` docs](https://www.rubydoc.info/github/neovim/neovim-ruby/main/Neovim) for other ways to connect to `nvim`, and the [`Neovim::Client` docs](https://www.rubydoc.info/github/neovim/neovim-ruby/main/Neovim/Client) for a summary of the client interface.
44
44
 
45
45
  ### Plugins
46
46
 
@@ -72,7 +72,7 @@ end
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
74
 
75
- Refer to the [`Neovim::Plugin::DSL` docs](https://www.rubydoc.info/github/neovim/neovim-ruby/master/Neovim/Plugin/DSL) for a more complete overview of the `Neovim.plugin` DSL.
75
+ Refer to the [`Neovim::Plugin::DSL` docs](https://www.rubydoc.info/github/neovim/neovim-ruby/main/Neovim/Plugin/DSL) for a more complete overview of the `Neovim.plugin` DSL.
76
76
 
77
77
  ### Vim Plugin Support
78
78
 
@@ -85,7 +85,7 @@ The Neovim gem also acts as a compatibility layer for Ruby plugins written for `
85
85
  * CI: <https://github.com/neovim/neovim-ruby/actions>
86
86
  * Documentation:
87
87
  * Latest Gem: <https://rubydoc.info/gems/neovim>
88
- * Master: <https://rubydoc.info/github/neovim/neovim-ruby/master/frames>
88
+ * Main: <https://rubydoc.info/github/neovim/neovim-ruby/main>
89
89
 
90
90
  ## Contributing
91
91
 
data/Rakefile CHANGED
@@ -1,24 +1,15 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
- require "rubocop/rake_task"
4
3
 
5
4
  Bundler.setup
6
5
 
7
- RuboCop::RakeTask.new(:linter)
8
-
9
6
  namespace :spec do
10
7
  desc "Run functional specs"
11
8
  RSpec::Core::RakeTask.new(:functional)
12
9
 
13
10
  desc "Run acceptance specs"
14
11
  task acceptance: "acceptance:deps" do
15
- run_script(
16
- "run_acceptance.rb",
17
- "--reporter", "dot",
18
- # TODO: remove once rubyeval is merged in nvim
19
- "--exclude", "rubyeval",
20
- "spec/acceptance"
21
- )
12
+ run_script("run_acceptance.rb", "--reporter", "dot", "spec/acceptance")
22
13
  end
23
14
 
24
15
  namespace :acceptance do
@@ -45,7 +36,7 @@ end
45
36
  desc "Run specs"
46
37
  task spec: [:"spec:functional", :"spec:acceptance"]
47
38
 
48
- task default: [:linter, :spec]
39
+ task default: :spec
49
40
 
50
41
  def run_script(relpath, *args)
51
42
  path = File.expand_path("script/#{relpath}", __dir__)
data/lib/neovim/buffer.rb CHANGED
@@ -4,7 +4,7 @@ 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.4.4
7
+ # The methods documented here were generated using NVIM v0.9.1
8
8
  class Buffer < RemoteObject
9
9
  attr_reader :lines
10
10
 
@@ -54,7 +54,7 @@ module Neovim
54
54
  # @param index [Integer]
55
55
  # @return [String]
56
56
  def [](index)
57
- check_index(index)
57
+ check_index(index, 1)
58
58
  @lines[index - 1]
59
59
  end
60
60
 
@@ -64,7 +64,7 @@ module Neovim
64
64
  # @param str [String]
65
65
  # @return [String]
66
66
  def []=(index, str)
67
- check_index(index)
67
+ check_index(index, 1)
68
68
  @lines[index - 1] = str
69
69
  end
70
70
 
@@ -73,13 +73,16 @@ module Neovim
73
73
  # @param index [Integer]
74
74
  # @return [void]
75
75
  def delete(index)
76
- check_index(index)
76
+ check_index(index, 1)
77
77
  @lines.delete(index - 1)
78
78
  nil
79
79
  end
80
80
 
81
81
  # Append a line after the given line (1-indexed).
82
82
  #
83
+ # Unlike the other methods, `0` is a valid index argument here, and inserts
84
+ # into the first line of the buffer.
85
+ #
83
86
  # To maintain backwards compatibility with +vim+, the cursor is forced back
84
87
  # to its previous position after inserting the line.
85
88
  #
@@ -87,7 +90,7 @@ module Neovim
87
90
  # @param str [String]
88
91
  # @return [String]
89
92
  def append(index, str)
90
- check_index(index)
93
+ check_index(index, 0)
91
94
  window = @session.request(:nvim_get_current_win)
92
95
  cursor = window.cursor
93
96
 
@@ -127,8 +130,8 @@ module Neovim
127
130
 
128
131
  private
129
132
 
130
- def check_index(index)
131
- raise ArgumentError, "Index out of bounds" if index < 0
133
+ def check_index(index, min)
134
+ raise ArgumentError, "Index out of bounds" if index < min
132
135
  end
133
136
 
134
137
  public
@@ -164,6 +167,24 @@ module Neovim
164
167
  @param [Array<String>] replacement
165
168
  @return [void]
166
169
 
170
+ @method set_text(start_row, start_col, end_row, end_col, replacement)
171
+ See +:h nvim_buf_set_text()+
172
+ @param [Integer] start_row
173
+ @param [Integer] start_col
174
+ @param [Integer] end_row
175
+ @param [Integer] end_col
176
+ @param [Array<String>] replacement
177
+ @return [void]
178
+
179
+ @method get_text(start_row, start_col, end_row, end_col, opts)
180
+ See +:h nvim_buf_get_text()+
181
+ @param [Integer] start_row
182
+ @param [Integer] start_col
183
+ @param [Integer] end_row
184
+ @param [Integer] end_col
185
+ @param [Hash] opts
186
+ @return [Array<String>]
187
+
167
188
  @method get_offset(index)
168
189
  See +:h nvim_buf_get_offset()+
169
190
  @param [Integer] index
@@ -197,11 +218,6 @@ module Neovim
197
218
  @param [String] lhs
198
219
  @return [void]
199
220
 
200
- @method get_commands(opts)
201
- See +:h nvim_buf_get_commands()+
202
- @param [Hash] opts
203
- @return [Hash]
204
-
205
221
  @method set_var(name, value)
206
222
  See +:h nvim_buf_set_var()+
207
223
  @param [String] name
@@ -213,21 +229,6 @@ module Neovim
213
229
  @param [String] name
214
230
  @return [void]
215
231
 
216
- @method get_option(name)
217
- See +:h nvim_buf_get_option()+
218
- @param [String] name
219
- @return [Object]
220
-
221
- @method set_option(name, value)
222
- See +:h nvim_buf_set_option()+
223
- @param [String] name
224
- @param [Object] value
225
- @return [void]
226
-
227
- @method get_number
228
- See +:h nvim_buf_get_number()+
229
- @return [Integer]
230
-
231
232
  @method get_name
232
233
  See +:h nvim_buf_get_name()+
233
234
  @return [String]
@@ -245,11 +246,94 @@ module Neovim
245
246
  See +:h nvim_buf_is_valid()+
246
247
  @return [Boolean]
247
248
 
249
+ @method del_mark(name)
250
+ See +:h nvim_buf_del_mark()+
251
+ @param [String] name
252
+ @return [Boolean]
253
+
254
+ @method set_mark(name, line, col, opts)
255
+ See +:h nvim_buf_set_mark()+
256
+ @param [String] name
257
+ @param [Integer] line
258
+ @param [Integer] col
259
+ @param [Hash] opts
260
+ @return [Boolean]
261
+
248
262
  @method get_mark(name)
249
263
  See +:h nvim_buf_get_mark()+
250
264
  @param [String] name
251
265
  @return [Array<Integer>]
252
266
 
267
+ @method call(fun)
268
+ See +:h nvim_buf_call()+
269
+ @param [LuaRef] fun
270
+ @return [Object]
271
+
272
+ @method create_user_command(name, command, opts)
273
+ See +:h nvim_buf_create_user_command()+
274
+ @param [String] name
275
+ @param [Object] command
276
+ @param [Hash] opts
277
+ @return [void]
278
+
279
+ @method del_user_command(name)
280
+ See +:h nvim_buf_del_user_command()+
281
+ @param [String] name
282
+ @return [void]
283
+
284
+ @method get_commands(opts)
285
+ See +:h nvim_buf_get_commands()+
286
+ @param [Hash] opts
287
+ @return [Hash]
288
+
289
+ @method get_number
290
+ See +:h nvim_buf_get_number()+
291
+ @return [Integer]
292
+
293
+ @method clear_highlight(ns_id, line_start, line_end)
294
+ See +:h nvim_buf_clear_highlight()+
295
+ @param [Integer] ns_id
296
+ @param [Integer] line_start
297
+ @param [Integer] line_end
298
+ @return [void]
299
+
300
+ @method set_virtual_text(src_id, line, chunks, opts)
301
+ See +:h nvim_buf_set_virtual_text()+
302
+ @param [Integer] src_id
303
+ @param [Integer] line
304
+ @param [Array] chunks
305
+ @param [Hash] opts
306
+ @return [Integer]
307
+
308
+ @method get_extmark_by_id(ns_id, id, opts)
309
+ See +:h nvim_buf_get_extmark_by_id()+
310
+ @param [Integer] ns_id
311
+ @param [Integer] id
312
+ @param [Hash] opts
313
+ @return [Array<Integer>]
314
+
315
+ @method get_extmarks(ns_id, start, end, opts)
316
+ See +:h nvim_buf_get_extmarks()+
317
+ @param [Integer] ns_id
318
+ @param [Object] start
319
+ @param [Object] end
320
+ @param [Hash] opts
321
+ @return [Array]
322
+
323
+ @method set_extmark(ns_id, line, col, opts)
324
+ See +:h nvim_buf_set_extmark()+
325
+ @param [Integer] ns_id
326
+ @param [Integer] line
327
+ @param [Integer] col
328
+ @param [Hash] opts
329
+ @return [Integer]
330
+
331
+ @method del_extmark(ns_id, id)
332
+ See +:h nvim_buf_del_extmark()+
333
+ @param [Integer] ns_id
334
+ @param [Integer] id
335
+ @return [Boolean]
336
+
253
337
  @method add_highlight(ns_id, hl_group, line, col_start, col_end)
254
338
  See +:h nvim_buf_add_highlight()+
255
339
  @param [Integer] ns_id
@@ -266,20 +350,16 @@ module Neovim
266
350
  @param [Integer] line_end
267
351
  @return [void]
268
352
 
269
- @method clear_highlight(ns_id, line_start, line_end)
270
- See +:h nvim_buf_clear_highlight()+
271
- @param [Integer] ns_id
272
- @param [Integer] line_start
273
- @param [Integer] line_end
274
- @return [void]
353
+ @method get_option(name)
354
+ See +:h nvim_buf_get_option()+
355
+ @param [String] name
356
+ @return [Object]
275
357
 
276
- @method set_virtual_text(ns_id, line, chunks, opts)
277
- See +:h nvim_buf_set_virtual_text()+
278
- @param [Integer] ns_id
279
- @param [Integer] line
280
- @param [Array] chunks
281
- @param [Hash] opts
282
- @return [Integer]
358
+ @method set_option(name, value)
359
+ See +:h nvim_buf_set_option()+
360
+ @param [String] name
361
+ @param [Object] value
362
+ @return [void]
283
363
 
284
364
  =end
285
365
  end