Class: Neovim::Client
- Inherits:
-
Object
show all
- Defined in:
- lib/neovim/client.rb
Overview
Client to a running nvim
instance. The interface is generated at runtime via the vim_get_api_info
RPC call. Some methods return RemoteObject
subclasses (i.e. Buffer
, Window
, or Tabpage
), which similarly have dynamically generated interfaces.
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(session) ⇒ Client
Returns a new instance of Client.
15
16
17
18
|
# File 'lib/neovim/client.rb', line 15
def initialize(session)
@session = session
@api = session.api
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
Intercept method calls and delegate to appropriate RPC methods.
21
22
23
24
25
26
27
|
# File 'lib/neovim/client.rb', line 21
def method_missing(method_name, *args)
if func = @api.function("vim_#{method_name}")
func.call(session, *args)
else
super
end
end
|
Instance Attribute Details
#session ⇒ Object
Returns the value of attribute session.
13
14
15
|
# File 'lib/neovim/client.rb', line 13
def session
@session
end
|
Instance Method Details
#call_function(fname, args) ⇒ Object
|
# File 'lib/neovim/client.rb', line 63
|
#change_directory(dir) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 63
|
#command(str) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 63
|
#command_output(str) ⇒ String
|
# File 'lib/neovim/client.rb', line 63
|
Access to objects belonging to the current nvim
context.
47
48
49
|
# File 'lib/neovim/client.rb', line 47
def current
Current.new(@session)
end
|
#del_current_line ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 63
|
#err_write(str) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 63
|
#eval(str) ⇒ Object
|
# File 'lib/neovim/client.rb', line 63
|
#feedkeys(keys, mode, escape_csi) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 63
|
#get_api_info ⇒ Array
|
# File 'lib/neovim/client.rb', line 63
|
#get_buffers ⇒ Array<Buffer>
|
# File 'lib/neovim/client.rb', line 63
|
#get_color_map ⇒ Dictionary
|
# File 'lib/neovim/client.rb', line 63
|
#get_current_buffer ⇒ Buffer
|
# File 'lib/neovim/client.rb', line 63
|
#get_current_line ⇒ String
|
# File 'lib/neovim/client.rb', line 63
|
#get_current_tabpage ⇒ Tabpage
|
# File 'lib/neovim/client.rb', line 63
|
#get_current_window ⇒ Window
|
# File 'lib/neovim/client.rb', line 63
|
#get_option(name) ⇒ Object
|
# File 'lib/neovim/client.rb', line 63
|
#get_tabpages ⇒ Array<Tabpage>
|
# File 'lib/neovim/client.rb', line 63
|
#get_var(name) ⇒ Object
|
# File 'lib/neovim/client.rb', line 63
|
#get_vvar(name) ⇒ Object
|
# File 'lib/neovim/client.rb', line 63
|
#get_windows ⇒ Array<Window>
|
# File 'lib/neovim/client.rb', line 63
|
|
# File 'lib/neovim/client.rb', line 63
|
#list_runtime_paths ⇒ Array<String>
|
# File 'lib/neovim/client.rb', line 63
|
#methods ⇒ Object
Extend methods
to include RPC methods.
35
36
37
|
# File 'lib/neovim/client.rb', line 35
def methods
super | rpc_methods
end
|
#name_to_color(name) ⇒ Fixnum
|
# File 'lib/neovim/client.rb', line 63
|
#out_write(str) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 63
|
#replace_termcodes(str, from_part, do_lt, special) ⇒ String
|
# File 'lib/neovim/client.rb', line 63
|
#report_error(str) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 63
|
#respond_to?(method_name) ⇒ Boolean
Extend respond_to?
to support RPC methods.
30
31
32
|
# File 'lib/neovim/client.rb', line 30
def respond_to?(method_name)
super || rpc_methods.include?(method_name.to_sym)
end
|
#set_current_buffer(buffer) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 63
|
#set_current_line(line) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 63
|
#set_current_tabpage(tabpage) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 63
|
#set_current_window(window) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 63
|
#set_option(name, value) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 63
|
#set_var(name, value) ⇒ Object
|
# File 'lib/neovim/client.rb', line 63
|
#strwidth(str) ⇒ Fixnum
|
# File 'lib/neovim/client.rb', line 63
|
#subscribe(event) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 63
|
#unsubscribe(event) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 63
|