Module: Neovim::OptionAccess

Included in:
Client, RemoteObject
Defined in:
lib/neovim/remote_object.rb

Instance Method Summary collapse

Instance Method Details

#get_option(name, *args) ⇒ Object Also known as: get_options



13
14
15
16
17
18
19
20
# File 'lib/neovim/remote_object.rb', line 13

def get_option name, *args
  vs = [name, *args].map { |a| call_api :get_option_value, a, option_params }
  if args.empty? then
    vs.first
  else
    vs
  end
end

#option_paramsObject



31
32
33
34
35
36
# File 'lib/neovim/remote_object.rb', line 31

def option_params
  r = {}
  n = self.class::OPTION_PARAM
  r[ n] = @index if n
  r
end

#set_option(*args, **kwargs) ⇒ Object Also known as: set_options



23
24
25
26
27
28
# File 'lib/neovim/remote_object.rb', line 23

def set_option *args, **kwargs
  op = option_params
  args.each   { |a|   call_api :set_option_value, a, true, op }
  kwargs.each { |k,v| call_api :set_option_value, k, v,    op }
  nil
end