File: functions.rb

package info (click to toggle)
ruby-neovim 0.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 548 kB
  • sloc: ruby: 4,178; sh: 23; makefile: 4
file content (25 lines) | stat: -rw-r--r-- 670 bytes parent folder | download | duplicates (3)
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
Neovim.plugin do |plug|
  plug.function(:RPluginFunctionArgs, sync: true) do |nvim, *args|
    args
  end

  plug.function(:RPluginFunctionRange, range: true, sync: true) do |nvim, start, stop|
    nvim.set_var("rplugin_function_range", [start, stop])
  end

  plug.function(:RPluginFunctionEval, eval: "g:to_eval", sync: true) do |nvim, to_eval|
    to_eval.merge(b: 43)
  end

  plug.function(:RPluginFunctionAsync) do |nvim|
    nvim.set_var("rplugin_function_async", true)
  end

  plug.function(:RPluginFunctionRecursive, sync: true, nargs: 1) do |nvim, n|
    if n >= 10
      n
    else
      nvim.evaluate("RPluginFunctionRecursive(#{n + 1})")
    end
  end
end