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
19
20
|
# File 'lib/neovim/client.rb', line 15
def initialize(session)
session.discover_api
@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.
23
24
25
26
27
28
29
|
# File 'lib/neovim/client.rb', line 23
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 65
|
#change_directory(dir) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 65
|
#command(str) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 65
|
#command_output(str) ⇒ String
|
# File 'lib/neovim/client.rb', line 65
|
Access to objects belonging to the current nvim
context.
49
50
51
|
# File 'lib/neovim/client.rb', line 49
def current
@current ||= Current.new(@session)
end
|
#del_current_line ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 65
|
#err_write(str) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 65
|
#eval(str) ⇒ Object
|
# File 'lib/neovim/client.rb', line 65
|
#feedkeys(keys, mode, escape_csi) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 65
|
#get_api_info ⇒ Array
|
# File 'lib/neovim/client.rb', line 65
|
#get_buffers ⇒ Array<Buffer>
|
# File 'lib/neovim/client.rb', line 65
|
#get_color_map ⇒ Dictionary
|
# File 'lib/neovim/client.rb', line 65
|
#get_current_buffer ⇒ Buffer
|
# File 'lib/neovim/client.rb', line 65
|
#get_current_line ⇒ String
|
# File 'lib/neovim/client.rb', line 65
|
#get_current_tabpage ⇒ Tabpage
|
# File 'lib/neovim/client.rb', line 65
|
#get_current_window ⇒ Window
|
# File 'lib/neovim/client.rb', line 65
|
#get_option(name) ⇒ Object
|
# File 'lib/neovim/client.rb', line 65
|
#get_tabpages ⇒ Array<Tabpage>
|
# File 'lib/neovim/client.rb', line 65
|
#get_var(name) ⇒ Object
|
# File 'lib/neovim/client.rb', line 65
|
#get_vvar(name) ⇒ Object
|
# File 'lib/neovim/client.rb', line 65
|
#get_windows ⇒ Array<Window>
|
# File 'lib/neovim/client.rb', line 65
|
|
# File 'lib/neovim/client.rb', line 65
|
#list_runtime_paths ⇒ Array<String>
|
# File 'lib/neovim/client.rb', line 65
|
#methods ⇒ Object
Extend methods
to include RPC methods.
37
38
39
|
# File 'lib/neovim/client.rb', line 37
def methods
super | rpc_methods
end
|
#name_to_color(name) ⇒ Fixnum
|
# File 'lib/neovim/client.rb', line 65
|
#out_write(str) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 65
|
#replace_termcodes(str, from_part, do_lt, special) ⇒ String
|
# File 'lib/neovim/client.rb', line 65
|
#report_error(str) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 65
|
#respond_to?(method_name) ⇒ Boolean
Extend respond_to?
to support RPC methods.
32
33
34
|
# File 'lib/neovim/client.rb', line 32
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 65
|
#set_current_line(line) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 65
|
#set_current_tabpage(tabpage) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 65
|
#set_current_window(window) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 65
|
#set_option(name, value) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 65
|
#set_var(name, value) ⇒ Object
|
# File 'lib/neovim/client.rb', line 65
|
#strwidth(str) ⇒ Fixnum
|
# File 'lib/neovim/client.rb', line 65
|
#subscribe(event) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 65
|
#unsubscribe(event) ⇒ void
This method returns an undefined value.
|
# File 'lib/neovim/client.rb', line 65
|