Class: Neovim::ConnectionChild

Inherits:
Connection show all
Defined in:
lib/neovim/connection.rb

Constant Summary

Constants included from Logging

Logging::DEFAULT_LEVEL, Logging::LEVELS

Instance Attribute Summary

Attributes inherited from Connection

#client

Class Method Summary collapse

Methods inherited from Connection

#additional_data, #error, #initialize, #start

Methods included from Logging

put

Constructor Details

This class inherits a constructor from Neovim::Connection

Class Method Details

.open_files(*argv) ⇒ Object



114
115
116
117
118
119
120
121
122
# File 'lib/neovim/connection.rb', line 114

def open_files *argv
  eb = "--embed"
  argv.unshift eb unless argv.include? eb
  argv.unshift path
  IO.popen argv, "r+" do |io|
    Process.detach io.pid
    yield (new io, io)
  end
end

.pathObject



124
125
126
# File 'lib/neovim/connection.rb', line 124

def path
  ENV[ "NVIM_EXECUTABLE"].notempty? || "nvim"
end

.stdpath(what) ⇒ Object



134
135
136
137
138
139
# File 'lib/neovim/connection.rb', line 134

def stdpath what
  cmd = [ path, "--headless", ]
  cmd.push "-c", "echo stdpath(#{what.to_s.inspect})"
  cmd.push "-c", "q"
  (pipe_stderr cmd)&.tap { |x| x.chomp! }
end

.versionObject



128
129
130
131
132
# File 'lib/neovim/connection.rb', line 128

def version
  IO.popen [ path, "--version"] do |io|
    io.gets[ /\ANVIM +v?(.+)/, 1]
  end
end