Class: Neovim::Provider

Inherits:
Remote show all
Defined in:
lib/neovim/host.rb

Direct Known Subclasses

Host, Job

Constant Summary

Constants included from Logging

Logging::DEFAULT_LEVEL, Logging::LEVELS

Class Method Summary collapse

Methods inherited from Remote

#client_methods, #client_name, #client_type, #initialize, #notify, open, open_conn, #request, #run, run_remote, run_sub, #start, start_client

Methods included from Logging

put

Constructor Details

This class inherits a constructor from Neovim::Remote

Class Method Details

.run(plugins) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/neovim/host.rb', line 47

def run plugins
  $stdin.tty? and raise "This program expects to be called by Neovim. It can't run interactively."
  start plugins do |h|
    log :info, "Starting event loop."
    h.run
    nil
  rescue Remote::Disconnected
    log :fatal, "Disconnected"
    nil
  rescue SignalException
    n = $!.signm.notempty? || $!.class.to_s
    if n =~ /\A(?:SIG)?TERM\z/ then
      log :info, "Exiting after terminate signal."
      nil
    else
      log :fatal, "Signal was caught: #{n}"
      1
    end
  rescue Exception
    log_exception :fatal
    2
  end
end

.start(plugins) ⇒ Object



41
42
43
44
45
# File 'lib/neovim/host.rb', line 41

def start plugins
  super plugins, ConnectionStdio do |h|
    yield h
  end
end