Class: Neovim::ConnectionChild
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
Class Method Details
.open_files(*argv) ⇒ Object
120
121
122
123
124
125
126
127
128
|
# File 'lib/neovim/connection.rb', line 120
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
|
130
131
132
|
# File 'lib/neovim/connection.rb', line 130
def path
ENV[ "NVIM_EXECUTABLE"].notempty? || "nvim"
end
|
.stdpath(what) ⇒ Object
140
141
142
143
144
145
146
|
# File 'lib/neovim/connection.rb', line 140
def stdpath what
cmd = [ path, "--headless", ]
cmd.push "-u", "NONE"
cmd.push "-c", "echo stdpath(#{what.to_s.inspect})"
cmd.push "-c", "q"
(pipe_stderr cmd)&.tap { |x| x.chomp! }
end
|
134
135
136
137
138
|
# File 'lib/neovim/connection.rb', line 134
def version
IO.popen [ path, "--version"] do |io|
io.gets[ /\ANVIM +v?(.+)/, 1]
end
end
|