nvim 1.5.1 → 1.6.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2f33b262cf70f6226c1af40d6b6173c56f5d808e7e4ba6629caa342f3131944
4
- data.tar.gz: b78833e0442c2ba8e6a74786576bb4dcfecf5ecebf005bd45dd1c9b4a49732f5
3
+ metadata.gz: dbd0024450444336d8516c543f5bf6b9ac1f0a6a08a8e342f03a413e20794bcd
4
+ data.tar.gz: 5ecd7b84dccc752f82aaf303ad146e5b7462478bc8a58eb25f70fb9393b30e6f
5
5
  SHA512:
6
- metadata.gz: 49a0ba665e6d93a4f629b1b0375c29237d90cbb2510bb99d4ff3e4533f7e5cab68c76ee841cc7b25a5117411f5fb5e2ab24d3763f9cf4fa9617b9bef4d693cab
7
- data.tar.gz: 1dafb13f71a994566f383577de178766fa6e0dc05a36075dc2af53c77cf3c5a0c8b21ac8dc08835fcbe89824441b857a193cfa8a503537f8ad642775276b8f6b
6
+ metadata.gz: 5dfce6dc61d6c2910f8e1a273324682524246f92c9b7f9d62c8a6c9b915852b7d359b02435039105d6bcf811719a3f9e6a8579f8851f87e0c49e7f8b0182d389
7
+ data.tar.gz: 1b58e82f140457815c0ff571aff1a209f591ff3f301269140685f0a5098d3efc315c318797fb22ea10d77c2ab34536f0c220a4ee6cc62c03a5da46a1150992c7
data/INFO.yaml CHANGED
@@ -3,7 +3,7 @@
3
3
  #
4
4
 
5
5
  nvim:
6
- version: 1.5.1
6
+ version: 1.6.0
7
7
  license: BSD-2-Clause+
8
8
  authors:
9
9
  - Bertram Scharpf
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  # BSD-2-clause license, extended by language use conditions
2
2
 
3
- Copyright (C) 2024, Bertram Scharpf <software@bertram-scharpf.de>.
3
+ Copyright (C) 2024-2025, Bertram Scharpf <software@bertram-scharpf.de>.
4
4
  All rights reserved.
5
5
 
6
6
  Redistribution and use in source and binary forms, with or without
data/README.md CHANGED
@@ -207,6 +207,52 @@ Yet, you should avoid to use `fork` and `exec`, except when
207
207
  you're absolutely sure what you're doing.
208
208
 
209
209
 
210
+ #### Global variables
211
+
212
+ The global variable `$vim` will be set to the client.
213
+
214
+ ```
215
+ ~
216
+ ~
217
+ :ruby $vim.command "split"
218
+ ```
219
+
220
+ Further, the variables `$range` and `$lines` will be set.
221
+
222
+ ```
223
+ 1 foo
224
+ 2 bar
225
+ 3 baz
226
+ ~
227
+ :%ruby puts $range.inspect, $lines.inspect
228
+ ```
229
+
230
+ The legacy variables `$curbuf` and `$curwin` are supported.
231
+
232
+ ```
233
+ ~
234
+ ~
235
+ :ruby puts $curbuf.get_name, $curwin.get_height
236
+ ```
237
+
238
+
239
+ ### Requiring Ruby files
240
+
241
+ In addition to the `:rubyfile` command as documented, that command can also be
242
+ used to just require a Ruby file. Set the name into angle brackets, and the
243
+ file will be searched in `$:`. Sorry, file name completion will not work.
244
+
245
+ ```
246
+ ~
247
+ ~
248
+ :rubyfile <yaml>
249
+ ```
250
+
251
+ In this case, the global variables `$range` and `$lines` will not be set. Yet,
252
+ `$vim` still will be available. See the
253
+ [Nxxd](https://github.com/BertramScharpf/ruby-nxxd) gem for a nice example.
254
+
255
+
210
256
  ### List all API functions
211
257
 
212
258
  To show a list of the API functions call something like this:
@@ -377,7 +423,7 @@ Make a hex dump.
377
423
  ruby <<EOT
378
424
  require "neovim/foreign/xxd"
379
425
  bn = $curbuf.get_name
380
- $vim.command :new
426
+ $vim.command :enew!
381
427
  File.open bn do |b| Xxd::Dump.new.run b do |l| $vim.put [l], "l", false, true end end
382
428
  EOT
383
429
  ```
@@ -385,6 +431,6 @@ EOT
385
431
 
386
432
  ## Copyright
387
433
 
388
- * (C) 2024 Bertram Scharpf <software@bertram-scharpf.de>
434
+ * (C) 2024,2025 Bertram Scharpf <software@bertram-scharpf.de>
389
435
  * License: [BSD-2-Clause+](./LICENSE)
390
436
 
data/lib/neovim/client.rb CHANGED
@@ -16,9 +16,6 @@ module Neovim
16
16
  attr_accessor :strict
17
17
  end
18
18
 
19
- class UnknownApiFunction < RuntimeError ; end
20
- class UnknownApiObjectFunction < RuntimeError ; end
21
-
22
19
 
23
20
  attr_reader :channel_id
24
21
 
data/lib/neovim/info.rb CHANGED
@@ -1,10 +1,10 @@
1
1
  require "neovim/meta.rb"
2
2
  Neovim::INFO = Neovim::Meta.new "nvim",
3
- version: "1.5.1",
3
+ version: "1.6.0",
4
4
  license: "BSD-2-Clause+",
5
5
  authors: ["Bertram Scharpf"],
6
6
  email: "software@bertram-scharpf.de",
7
7
  summary: "Yet another Ruby client for Neovim",
8
8
  description: "A simple Ruby client for Neovim.\nClean code, minimal dependecies, no frills, no wokeness.",
9
9
  homepage: "https://github.com/BertramScharpf/ruby-nvim",
10
- commit: "3508371"
10
+ commit: "b2ddce4"
@@ -38,6 +38,9 @@ module Neovim
38
38
  end
39
39
 
40
40
 
41
+ class UnknownApiFunction < RuntimeError ; end
42
+ class UnknownApiObjectFunction < RuntimeError ; end
43
+
41
44
 
42
45
  class RemoteObject
43
46
 
@@ -203,11 +203,17 @@ module Neovim
203
203
 
204
204
  # This is called by the +:rubyfile+ command.
205
205
  dsl.rpc :ruby_execute_file do |client,path,fst,lst|
206
- set_globals client, fst..lst do ||
207
- r = File.read path
208
- script_binding.eval r, "ruby_file #{path}"
206
+ if path =~ /<(.*)>\z/ then
207
+ set_global_client client do
208
+ require $1
209
+ end
210
+ else
211
+ set_globals client, fst..lst do ||
212
+ r = File.read path
213
+ script_binding.eval r, "ruby_file #{path}"
214
+ end
215
+ nil
209
216
  end
210
- nil
211
217
  end
212
218
 
213
219
  # This is called by the +:rubydo+ command.
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nvim
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bertram Scharpf
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-14 00:00:00.000000000 Z
10
+ date: 2025-01-26 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  email: software@bertram-scharpf.de
13
13
  executables: