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
119
120
121
122
123
124
125
126
127
|
# File 'lib/neovim/connection.rb', line 119
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
|
129
130
131
|
# File 'lib/neovim/connection.rb', line 129
def path
ENV[ "NVIM_EXECUTABLE"].notempty? || "nvim"
end
|
.stdpath(what) ⇒ Object
139
140
141
142
143
144
|
# File 'lib/neovim/connection.rb', line 139
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
|
133
134
135
136
137
|
# File 'lib/neovim/connection.rb', line 133
def version
IO.popen [ path, "--version"] do |io|
io.gets[ /\ANVIM +v?(.+)/, 1]
end
end
|